Thanks for everyone because of helping me ^^ my problem is resolved !
I meet problem when I use Singleton in inner class using C++ language. Please help me and sorry for my bad English.
class A: public AA
{
class InnerA
{
private:
static InnerA* _innerA;
public:
~InnerA();
void Release();
static InnerA* GetInstance()
{
if (_innerA == NULL)
{
static InnerA static_instance;
_innerA = &static_instance;
}
return _innerA ;
};
.....
The console show the below error after compiling :
undefined reference to `A::InnerA::_innerA'
I also modify like below code, but I still meet the above error.
class A: public AA
{
class InnerA
{
private:
static InnerA* _innerA;
public:
~InnerA();
void Release();
static InnerA* GetInstance()
{
if (A::InnerA::_innerA == NULL)
{
static A::InnerA::_innerA static_instance;
_A::InnerA::_innerA = &static_instance;
}
return A::InnerA::_innerA;
};
.....
Please help me !!! Thanks very much