What's the reason for typedefs
not being strongly typed? Is there any benefit I can't see or is it due to backward compatibility? See this example:
typedef int Velocity;
void foo(Velocity v) {
//do anything;
}
int main() {
int i=4;
foo(i); //Should result in compile error if strongly typed.
return 0;
}
I am not asking for workarounds to get a strong typed datatype but only want to know why the standard isn't requiring typedefs
to be strongly typed?
Thank you.