Hello, I have an object of class which has private constructor:
class CL_GUIComponent
{
// ...
private:
CL_SharedPtr<CL_GUIComponent_Impl> impl;
CL_GUIComponent(CL_GUIComponent &other);
CL_GUIComponent &operator =(const CL_GUIComponent &other);
CL_GraphicContext dummy_gc;
};
I have a class which has a pointer to the object of the type I described before.
class Some
{
private:
CL_GUIComponent *obj;
public:
CL_GUIComponent getComp() { return *obj; }
}
But this code calls the error:
In member function ‘CL_GUIComponent Some::getComp()’:
error: ‘CL_GUIComponent::CL_GUIComponent(CL_GUIComponent&)’ is private
error: within this context
How can I store and get that object?