mp_units::quantity_like_traits¶
Provides support for external quantity-like types
Synopsis¶
Declared in <mp-units/framework/customization_points.h>
template<typename T>
struct quantity_like_traits;
Description¶
The type trait should provide the reference object, a type alias rep, and static member functions to_numerical_value(T) that returns the raw value of the quantity and from_numerical_value(rep) that returns T from rep.
If the following expression is true, the specified conversion will be explicit:
explicit_importfor the conversion fromTto aquantitytype,explicit_exportfor the conversion from aquantitytype toT.
Usage example can be found in mp-units/systems/si/chrono.h header file.
Specializations¶
Template Parameters¶
| Name | Description |
|---|---|
| T | the type to provide support for |