Before C++11, I could use this to make a class non-copyable:
private:
MyClass(const MyClass&);
MyClass& operator=(const MyClass&);
With C++11, I can do it like this instead:
MyClass(const MyClass&) = delete;
MyClass& operator=(const MyClass&) = delete;
When using the class with the deleted copy and assignment, is there a chance that a default move operator is generated? And the class is not exactly copied, but moved (which is sort of similar) after all?
So, do I have to do this to prevent default move construction and assignmnent:
MyClass(MyClass&&) = delete;
MyClass& operator=(MyClass&&) = delete;
... ?
As others already mentioned in the comments, deleted constructors was introduced in C++11. To answer your question, the following rules hold in general:
As requested in the comments, here are some sources (C++11 is draft N3242):