template<class A> class Foo {}
class Bar : public Foo<Bar::Baz>
{
public:
class Baz {};
};
Nested class forward declarations
Is it possible to do something like the following:
This doesn't seem like an unreasonable thing to do, but there doesn't seem to be any way of doing it. Of course I could move Baz into global scope (which is what I'm about to do), but I'm curious if there is a way of doing this or a good reason why it can't be done.
There is something that get's close to that:
I mean... if you need class C to be private, I don't know how. Besides, this method is basically the same as declaring class C as global.
template <class Type>class A{ };class B_aux{ public: class C { };};class B : public B_aux, public A<B_aux::C>{ };
I mean... if you need class C to be private, I don't know how. Besides, this method is basically the same as declaring class C as global.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement