Forward a typedef

Started by
4 comments, last by genne 19 years, 9 months ago
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
Advertisement
Nope, you can't forward typedef's.
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Foward as in declare?

A typedef is always a declaration. It has no definition.
Shit... Oh well, thanks anyway!
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;
-Mike
Well, it's only to make things more comfortable!

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