Nested class forward declarations

Started by
0 comments, last by Kalazart 18 years, 1 month ago
Is it possible to do something like the following:

template<class A> class Foo {}

class Bar : public Foo<Bar::Baz>
{
public:
  class Baz {};
};

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.
Advertisement
There is something that get's close to that:

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