Please see the example code below:
class A { private: class B { public: foobar(); }; public: foo(); bar(); };
If you want to reuse functionality from A then you should inherit from A not nest B inside it.