Forward a typedef
How do you do that? Forward a typedef, is it possible?? You can forward classes, structs, functions or what ever, but not typedefs?
Thanks, Genne
What are you trying to do? Typedefs don't need to be forwarded since they're just aliases.
This works fine:
class foo;
typedef foo bar;
This works fine:
class foo;
typedef foo bar;
Well, it's only to make things more comfortable!
For example, in one header file i have the definition of the matrix template class:
and below some typedefs for matrix classes with different dimensions:
So now, in the header file for my renderer i would like only to forward the declaration (or typedef) of Matrix4. I thought that "perhaps there are some easy way to forward this typedef which i just doesn't know of", but of course i was wrong. Now instead i first have to forward the Matrix template class, and then make a new typedef to be able to use Matrix4. But well, as i said, it was just a question of comfort...
For example, in one header file i have the definition of the matrix template class:
template < int dim > class Matrix { /* ... */ };
and below some typedefs for matrix classes with different dimensions:
typedef Matrix< 3 > Matrix3;typedef Matrix< 4 > Matrix4;
So now, in the header file for my renderer i would like only to forward the declaration (or typedef) of Matrix4. I thought that "perhaps there are some easy way to forward this typedef which i just doesn't know of", but of course i was wrong. Now instead i first have to forward the Matrix template class, and then make a new typedef to be able to use Matrix4. But well, as i said, it was just a question of comfort...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement