Suppose there are types of "temperature"(T) and "distance"(D). Both, indeed, could be declared as usual typedefs:
typedef int T; // might be C++11 'using'
typedef int D;
But if I want an overloaded functions:
void f(T) {}
void f(D) {}
it will not work, because both types are identical.
Which most modern C++-way to realize such an overload?
It is clear that for those types must be distinguishable for compiler.
BOOST_STRONG_TYPEDEF
is made exactly for this purpose.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With