C++ – Forward declaration of a typedef in C++

cforward-declarationtypedef

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?

Best Answer

You can do forward typedef. But to do

typedef A B;

you must first forward declare A:

class A;

typedef A B;