Having a small problem with a constant function that creates a new object via new and throws it. The compiler barks that it cannot create the new object due to (presumably) call to a constructor.
Does this work? And if it does, how? I can't seem to find how to make it work...
Code:
MemoryManager::CMemoryManagerException<T>* pException = new MemoryManager::CMemoryManagerException<T>(_T("CMemoryManager::Lock"),
_T("CMemoryManager::Lock"),
GetMemoryExceptionErrMsg(p),
MemoryManager::CMemoryManagerException<T>::ERR_COULD_NOT_ALLOCATE);
That's the line it fails to compile.
'CMemoryManagerBase<T>::GetMemoryExceptionErrMsg' : cannot convert 'this' pointer from 'const CMemoryManagerBase<T>' to 'CMemoryManagerBase<T> &'
It's obviously because the function is const.