Question: In c++, is it *possible* to declare inner class (CInner) such that it has outer class (COuter) as its base class ? 

This question is about c++ technicalities. Not question of programming style or personal preferences.

Answer: 
Yes. This compiles:

```
class COuter
{
    class CInner;
};

class COuter::CInner : public COuter
{
};

```

The reason this is required is that a derived class requires that the entire definition be present for its own definition. So you just need to make sure that the outer class is completely defined before the inner class's definition starts.
The following code compiles and runs fine:

```
#include <iostream>

using namespace std;

class COuter
{
  public:
  COuter ()
  {
    cout << "COuter() called" << endl;
  }

  class CInner;
};

class COuter::CInner : public COuter
{
  public:
    CInner()
    {
      cout << "COuter::CInner() called" << endl;
    }
};

int main()
{
  COuter o;
  COuter::CInner i;

  return 0;
}

```

Output:

```
$ ./inner-outer.exe 
COuter() called
COuter() called
COuter::CInner() called

```