I have a singleton class A
, with virtual protected destructor
and private constructor
. I derived publicly from it and create class B.
Can i create two objects one each of base and derived class ?
If i cannot is there any other way to share same code ?
When i tried it i am getting compile time errors :
warning C4356: 'A::variable' : static data member cannot be initialized
via derived class
B.cpp(4): error C2371: 'variable' : redefinition; different basic types