I would like to use something like typedef in my C++ programs to enhance type safety.
As an example, suppose I have two functions
void function1(unsi
Use Boost strong typedef:
typedef
creates an alias for an existing type. It does not create a new type that can be used for matching either function or template parameters...Usage of BOOST_STRONG_TYPEDEF addresses this...
BOOST_STRONG_TYPEDEF
is a macro which generates a class named "name" wraps and instance of its primitive type and provides appropriate conversion operators in order to make the new type substitutable for the one that it wraps.