Function overloading for "integral" types

c++, c++11, integer, overloading

Solution

`BOOST_STRONG_TYPEDEF` is made exactly for this purpose.

Problem

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.

Original source