I have a container class which has a pre allocated buffer. I am calling memset() to use pre-allocated memory to create my objects. Since I am not using new, the constructor is not called.
Here is a simplified version of the add function
template<typename T>
T* CContainer<T>::Add()
{
memset(&m_pBuffer[index],0,index);
T* pReturnValue = reinterpret_cast<T*> ( &m_pBuffer[index] );
return pReturnValue;
}
Any way to call the constructor of template class T.
Thanks for your help.