You don't need the definition of a class to declare a function with that class as the return type. This little example compiles without problems:
Code:class B; class A { public: B getB(); }; class B : public A { }; B A::getB() { return B(); } int main() { A a; B b(a.getB()); }