qtty-cpp 0.4.5
Header-only C++ wrapper for qtty
Loading...
Searching...
No Matches
qtty.hpp File Reference

Main header for the qtty C++ wrapper library. More...

Include dependency graph for qtty.hpp:

Go to the source code of this file.

Namespaces

namespace  qtty
 

Functions

uint32_t qtty::abi_version ()
 Get the ABI version of the underlying qtty-ffi library.
 

Variables

struct { 
 
   int   qtty::major = 0 
 
   int   qtty::minor = 4 
 
   int   qtty::patch = 5 
 
qtty::version 
 Library version information.
 

Detailed Description

Main header for the qtty C++ wrapper library.

This header provides a modern, type-safe C++ interface to the qtty-ffi library. It includes:

  • Template-based Quantity class with compile-time unit checking
  • Operator overloading for natural arithmetic syntax
  • User-defined literals for convenient quantity creation
  • Support for the full qtty-ffi linear unit catalog, including pressure, solid angle, temperature, radiometry, photometric SI units, frequency, chemistry, electrical, and density families
  • Compound quotient units such as velocity through CompoundTag

Usage example:

using namespace qtty;
// Create quantities using constructors or literals
Meter distance(1000.0);
auto time = 20.0_s;
// Perform arithmetic operations
auto doubled = distance * 2.0;
// Convert units
Kilometer km = distance.to<Kilometer>();
// Derived quantities (velocity)
auto velocity = distance / time;
// New dimensions
Hectare field(2.5);
Newton force(9.8);
Joule energy(500.0);
Quantity< typename ExtractTag< TargetType >::type > to() const
Definition ffi_core.hpp:230

Definition in file qtty.hpp.