Unit Conversion and Dimensional Analysis Library 2.3.0
A compile-time c++14 unit conversion library
|
Defines a series of classes which contain dimensioned values. More...
Classes | |
class | units::unit_t< Units, T, NonLinearScale > |
Container for values which represent quantities of a given unit. More... | |
struct | units::unit_value_t< Units, Num, Denom > |
Stores a rational unit value as a compile-time constant. More... | |
Functions | |
template<class UnitType , typename T , class = std::enable_if_t<std::is_arithmetic<T>::value>> | |
constexpr UnitType | units::make_unit (const T value) noexcept |
Constructs a unit container from an arithmetic type. | |
Defines a series of classes which contain dimensioned values.
Unit containers store a value, and support various arithmetic operations.
|
inlineconstexprnoexcept |
Constructs a unit container from an arithmetic type.
make_unit can be used to construct a unit container from an arithmetic type, as an alternative to using the explicit constructor. Unlike the explicit constructor it forces the user to explicitly specify the units.
UnitType | Type to construct. |
Ty | Arithmetic type. |
[in] | value | Arithmetic value that represents a quantity in units of UnitType . |