Wrapper to allow a single conversion to another type. More...
#include <TTL_strong_type.h>
Public Member Functions | |
StrongTypeConversion (SOURCE_TYPE source_value) | |
operator TARGET_TYPE () const | |
Wrapper to allow a single conversion to another type.
For example
Conversion from Hz to Mhz can be achieved by defining
using FrequencyHzToMHz = StrongTypeConversion<FrequencyMHz, FrequencyHz, 1, 1000000>;
Then
FrequencyHz hz(1000000); FrequencyHz mhz = HzToMHz(hz);
Would give mhz = 1.
Definition at line 318 of file TTL_strong_type.h.
|
inline |
Definition at line 319 of file TTL_strong_type.h.
|
inline |
Definition at line 326 of file TTL_strong_type.h.