#include #include #include using namespace std; template class Bank{ public: static Bank *getInstance() { if ( Bank::mInstance == NULL ) { Bank::mInstance = new Bank(); } return Bank::mInstance; } static void deleteInstance(){ delete Bank::mInstance; Bank::mInstance = NULL; } private: static Bank *mInstance; map mItems; Bank() {} ~Bank() { map::iterator it; for (it = mItems.begin(); it != mItems.end(); it++) { delete it->first; } } }; template Bank *Bank::mInstance = NULL; int main () { return 0; } ////////////////////////////// //duke@keduix /home/duke/Projects $ g++ test.cpp -o test //test.cpp: In destructor ‘Bank::~Bank()’: //test.cpp:30: erreur: expected `;' before ‘it’ //test.cpp:31: erreur: ‘it’ was not declared in this scope /////////////////////////////