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
As you say, a typedef won't help you here. I can't think of a better way immediately, however if you go with your wrapping in a struct/class option you could use a conversion operator to eliminate the member method or function call.
For example:
struct WrappedType
{
operator type()
{
return _value;
}
type _value;
}
I'm not saying this is the way to do it mind you ;-)