c++ question
Posted: Thu Apr 01, 2004 5:19 pm
Shame on me, having problems with the c++ syntax.
The problem:
I have a singleton template like (thats not the problem ):
What i want to have is a map like:
But in fact i do not have any ideas how to implement that?
The problem:
I have a singleton template like (thats not the problem ):
Code: Select all
template <class T>
class TSingleton
{
protected:
TSingleton()
{
};
TSingleton(const TSingleton&)
{
};
TSingleton& operator=(const TSingleton&)
{
return *this;
};
public:
virtual ~TSingleton()
{
};
static T* getInstance()
{
static T Instance;
return &Instance;
};
};
Code: Select all
std::map< int, TSingleton*> SingletonMap;