a stupid idea in general.
Not stupid but it's called a class !
You can use templates to do what you're doing.
I'm not sure I completely agree, one of the most common usages for
such a typedef would probably be to create new types based on the
built-in types, and while it's possible to create a class that
perfectly mimics an int, it would be (relatively) very much work in
proportion to the benefits. And as soon as I wanted a second kind of
type, also behaving like an int I'd have to copy the whole class.
Using templates you can get away with using just one class definition,
but you still need that one definition. And there is always the risk
that the compiler won't be able to optimize away the wrapping (perhaps
not a big risk but anyway).
That doesn't matter that much. Firstly because all modern compilers (I