This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Stupid typedef question / g++


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]