Stupid typedef question / g++
John Love-Jensen
eljay@adobe.com
Fri Jan 24 17:08:00 GMT 2003
Hi SA,
No, that will not work. C++ does not have an "explicit typedef", rather it
has an aliasing typedef.
You can do something like this:
struct TYPE1 { int m; TYPE1(int in) : m(in) {} };
struct TYPE2 { int m; TYPE2(int in) : m(in) {} };
void test(TYPE1);
void test(TYPE2);
...et cetera. You can add more convenience routines to the two types, to
make them spoof "being an int" as much as you require.
--Eljay
More information about the Gcc-help
mailing list