#include<memory>
#include<iostream>
using namespace std;class Singleton
{
public:
static Singleton * GetInstance()  
{
if(NULL == m_pInstance.get())
{
m_pInstance.reset(new Singleton);
}
return m_pInstance.get();
}
private:
Singleton(){}   //prevented this singleton be produced in other place
friend class auto_ptr<Singleton>;       
static auto_ptr<Singleton> m_pInstance;
};int main()
{
Singleton * s1 = Singleton::GetInstance();
return 0;
}错误提示:
-------------------Configuration: shili - Win32 Debug--------------------
Compiling...
shili.cpp
C:\Documents and Settings\52332\僨僗僋僩僢僾\shili.cpp(13) : error C2039: 'reset' : is not a member of 'auto_ptr<class Singleton>'
Error executing cl.exe.shili.obj - 1 error(s), 0 warning(s)