I would like to inherit from a nested class that is in a private section of an outer class. Is it possible?
class A { friend class B; friend class C; private: class NiceNestedClass { }; }; class C { void a() { A::NiceNestedClass works; } }; class B : A::NiceNestedClass{ };
Activating NiceNestedClass is not a problem. But g ++ does not allow me to inherit it. Is there a workaround?
g++ -std=c++11 ac -oa ac:5:11: error: 'class A::NiceNestedClass' is private class NiceNestedClass { ^ ac:15:14: error: within this context class B : A::NiceNestedClass{
g ++ 4.8.4, std = C ++ 11
Dejwi source share