I'm going to omit quite bit of code because these are some rather large objects, and my question really just concerns the operation of std::make_shared . I have an object in namespace SYNC called called D3D11Shader. This has a static function called,
SYNC::D3D11Shader * SYNC::D3D11Shader::CreateInstance(const std::string & s)
which will take a string index and return a pointer to an instance of a shader that is derived from SYNC::D3D11Shader. At one point i started using smart pointers to automate deallocation of these within the vector that held all these shaders. However, when i go to do this,
std::shared_ptr<SYNC::D3D11Shader> shaderPtr;
// ... verification of index and other initialization happens here
// so i am unable to initialize it in it's constructor
shaderPtr = std::make_shared<SYNC::D3D11Shader>(SYNC::D3D11Shader::CreateShader(shaderName));
the compiler errors saying that i am trying to instanciate an instance of D3D11Shader in this line which is an abstract class. I thought all make_shared did was return an instance of std::shared_ptr. The CreateInstance function never tries to make an instance of this class, just objects that derive and implement it. I was not getting this error before using this function and the smart pointers. Does anyone know what's going on here?