typedef question
I want to use typedef to create a pointer to a class variable:
typedef PSURFACE (CSurface *);
This dosn´t work. Why?
Zeblar Nagrim, Lord of Chaos
Don''t you mean...
typedef BuiltInType *MyType;
The other thing you need to remember is that built-in type has to be defined, even if you just do "class BuiltInType;"
typedef BuiltInType *MyType;
The other thing you need to remember is that built-in type has to be defined, even if you just do "class BuiltInType;"
I suppose I could stick a little typedef question in here myself too, actually it''s more about templates but what the heck...starting a new thread would be a waste...anyways all I''m asking is if anybody knows if this is valid ANSI C++:
gcc (2.95.2 as well as an older version, egcs 2.91.something-I-think) chokes on this code but I know MSVC is quite happy with it.
"This album was written, recorded and edited at Gröndal, Stockholm in the year of 2000. At this point in time money still ruled the world. Capitalistic thoughts were wide spread. From the sky filled with the fumes of a billionarie''s cigar to the deepest abyss drenched in nuclear waste. A rich kid was a happy kid, oh..dirty, filthy times. Let this be a reminder."
- Fireside, taken from back of the Elite album
|
gcc (2.95.2 as well as an older version, egcs 2.91.something-I-think) chokes on this code but I know MSVC is quite happy with it.
"This album was written, recorded and edited at Gröndal, Stockholm in the year of 2000. At this point in time money still ruled the world. Capitalistic thoughts were wide spread. From the sky filled with the fumes of a billionarie''s cigar to the deepest abyss drenched in nuclear waste. A rich kid was a happy kid, oh..dirty, filthy times. Let this be a reminder."
- Fireside, taken from back of the Elite album
Okay, nevermind, I found a way around it...It had that very suggesting in gcc''s error message..duh..
Doing a typename A::size_type size_type would solve it all, and have the same desired effect.
"This album was written, recorded and edited at Gröndal, Stockholm in the year of 2000. At this point in time money still ruled the world. Capitalistic thoughts were wide spread. From the sky filled with the fumes of a billionarie''s cigar to the deepest abyss drenched in nuclear waste. A rich kid was a happy kid, oh..dirty, filthy times. Let this be a reminder."
- Fireside, taken from back of the Elite album
Doing a typename A::size_type size_type would solve it all, and have the same desired effect.
"This album was written, recorded and edited at Gröndal, Stockholm in the year of 2000. At this point in time money still ruled the world. Capitalistic thoughts were wide spread. From the sky filled with the fumes of a billionarie''s cigar to the deepest abyss drenched in nuclear waste. A rich kid was a happy kid, oh..dirty, filthy times. Let this be a reminder."
- Fireside, taken from back of the Elite album
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement