Defines a series of classes which contain dimensioned values. Unit containers store a value, and support various arithmetic operations.
More...
|
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. More...
|
|
Defines a series of classes which contain dimensioned values. Unit containers store a value, and support various arithmetic operations.
◆ make_unit()
template<class UnitType , typename T , class = std::enable_if_t<std::is_arithmetic<T>::value>>
constexpr UnitType units::make_unit |
( |
const T |
value | ) |
|
|
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.
- Template Parameters
-
UnitType | Type to construct. |
Ty | Arithmetic type. |
- Parameters
-
[in] | value | Arithmetic value that represents a quantity in units of UnitType . |