Forward declaration of a typedef in C++


Question

Why won't the compiler let me forward declare a typedef?

Assuming it's impossible, what's the best practice for keeping my inclusion tree small?

1
218
4/30/2009 12:21:06 AM

You can do forward typedef. But to do

typedef A B;

you must first forward declare A:

class A;

typedef A B;
158
6/4/2012 6:53:23 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon