I have class without copy constructor or assignment operator. I need to create and initialize a instance of that class. How do I do that?
Code with the problem (example):
class Q
{
int w;
public:
Q():w(19){};
Q(const Q&) = delete;
Q& operator = (const Q&) = delete;
static Q sQ;
};
Q Q::sQ = Q();
Use case: I have a class that is derived from QObject
and so has its assignment operator and copy constructor deleted. There should be a static instance of the class available, how can that be achieved?