What wrong with this code?
it doesn't compile...
template <typename T>
class CObjectsPool
{
public:
// static CObjectsPool<T>* GetInstance();
protected:
CObjectsPool();
~CObjectsPool();
private:
static CObjectsPool<T>* m_pInst;
};
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
template <typename T>
CObjectsPool<T>* CObjectsPool<T>::m_pInst = NULL;
template <typename T>
CObjectsPool<T>::CObjectsPool()
{
}
template <typename T>
CObjectsPool<T>::~CObjectsPool()
{
}
those are the errors:
SBPMsgResponse.h(85) : error C2059: syntax error : '<'
SBPMsgResponse.h(85) : error C2238: unexpected token(s) preceding ';'
Pool.h(44) : error C2989: 'CObjectsPool' : template class has already been defined as
onTypes\SBPMsgResponse.h(26) : see declaration of 'CObjectsPool'
Pool.h(32) : error C3857: 'CObjectsPool': multiple template parameter lists are not al
Pool.h(49) : error C2988: unrecognizable template declaration/definition
Pool.h(49) : error C2059: syntax error : '<'
Pool.h(49) : error C2039: 'm_pInst' : is not a member of 'operator``global namespace''
Pool.h(53) : error C2143: syntax error : missing ';' before '{'
Pool.h(53) : error C2447: '{' : missing function header (old-style formal list?)
Pool.h(57) : error C2988: unrecognizable template declaration/definition
Pool.h(57) : error C2059: syntax error : '<'
Pool.h(57) : error C2588: '::~CObjectsPool' : illegal global destructor
Pool.h(57) : fatal error C1903: unable to recover from previous error(s); stopping com
SBPMsgResponse.h(85) : error C2059: syntax error : '<'
SBPMsgResponse.h(85) : error C2238: unexpected token(s) preceding ';'
10x. alot !

