Store object of a class within the class itself
<p>I would like to know how to store an object of a class within the class itself.</p>

<p>I know that I have to use the static keyword to accomplish what I want.</p>

<p>thus the class should look something like</p>

<pre><code>class my_class {
public:
    static my_class instance;
    my_class() {
        my_class::instance = this
    }
};
</code></pre>

<p><strong>edit:</strong>
Below is the exact code as it appears in the class</p>

<pre><code>namespace ArmISA {
    class ISA {
        protected:
            static ISA* isa;
            MiscReg miscRegs[NumMiscRegs];
            const IntRegIndex *intRegMap;
            .....
        public:
            ISA() {
                ISA::isa = this;
                ...
            }
        ...
    };
}
</code></pre>

<p>The error I get is,
<code>error: could not convert 'ArmISA::ISA::isa' from 'ArmISA::ISA*' to 'ArmISA::ISA'</code></p>
