Thanks to anyone willing to help:
I am trying to create a Singleton class in C++ and I am new to the language. My scrum team methods say we should only use shared pointers. However, when I am trying to pass constructor into my Singleton object (shared pointer) I am getting error such as "binary '=' : no operator found which takes a right hand operand...". Basically non-compatible type conversion. Providing necessary code below:
//Singleton getter class
std::shared_ptr<LibMouse3d::LibCoreMouse3d::DeviceHandle> LibMouse3d::LibCoreMouse3d::DeviceHandle::getInstance(){
if(device == NULL){
//trying pass constructor into shared pointer object
device = LibMouse3d::LibCoreMouse3d::DeviceHandle();
}
return device;
}
This is my constructor:
LibMouse3d::LibCoreMouse3d::DeviceHandle::DeviceHandle() {
this->InitDevice();
}
And the object in header file
//singleton object - device
std::shared_ptr<DeviceHandle> device;
Thanks for any effort and sorry if I forgot something or added non-relevant info. This is my first question here, I could not google myself into answer for some time and I don't want my scrum master to be worried about my progress.