You cannot forward declare a typedef. Furthermore, you cannot forward declare std
classes - you just have to include the relevant files in these cases (<iosfwd>
is a notable exception, though).
So I don't think what you're trying to achieve here is possible. Just put your typedef in a header, and include that instead of a forward-declaration.
Btw.: Do not heap-allocate vector class members. A vector already takes care of heap-allocation internally. So having this:
class MyClass {
IntVec myVec; // No pointer
};
Makes the constructor obsolete, since myVec
is automatically default-constructed when you initialize a MyClass
in this case.