is it possible to have a virtual class declaration in a class?
<p>I'm setting a up an interface for various components of a framework in a personal project, and i've suddenly thought of something that i figured might be useful with an interface. My question is whether this is possible or not:</p>

<pre><code>class a
{
public:
    virtual class test = 0;

};

class b : public a
{
public:
    class test
    {
        public:
           int imember;
    };
};

class c : public a
{
public:
    class test
    {
    public:
           char cmember;  // just a different version of the class. within this class
    };
};
</code></pre>

<p>sort of declaring a virtual class or pure virtual class, that is required to be defined within the derived object, so that you might be able to do something like this:</p>

<pre><code>int main()
{
    a * meh = new b();
    a * teh = new c();

    /* these would be two different objects, but have the same name, and still be able  
 to be referred to by an interface pointer in the same way.*/
    meh::test object1;    
    teh::test object2;

    delete meh;
    delete teh;

    return 0;
}
</code></pre>

<p>msvc++ throws me a bunch of syntax errors, so is there a way to do this, and i'm just not writing it right?</p>
