How do I write a constructor mehtod call in this case
/*-----------*/
template<typena me Tclass CObjectPoolImpl
{
public:
void smth(T* pObj)
{
if (pObj)
pObj->T::T(); // an attempt to call a constructor method of
class T
}
};
CObjectPoolImpl <mynamespace::C MyTypeCF;
CMyType mt;
CF.smth(&mt);
/*-----------*/
MS Visual C++ 7.1:
error C2039: 'T' : is not a member of 'mynamespace::C MyType'
There is a reason not to write 'new T' and not to explicitly write
constructor method name (type name). Default constructor method for
CMyType exists.
/*-----------*/
template<typena me Tclass CObjectPoolImpl
{
public:
void smth(T* pObj)
{
if (pObj)
pObj->T::T(); // an attempt to call a constructor method of
class T
}
};
CObjectPoolImpl <mynamespace::C MyTypeCF;
CMyType mt;
CF.smth(&mt);
/*-----------*/
MS Visual C++ 7.1:
error C2039: 'T' : is not a member of 'mynamespace::C MyType'
There is a reason not to write 'new T' and not to explicitly write
constructor method name (type name). Default constructor method for
CMyType exists.
Comment