I have a use case that my object must not be copied in any way. I have written an exaggerated complete list of copy constructor and copy assignment operator deletions below. There are so many of them that I can't make sure which ones to use, and sometimes this makes me paranoid. I don't have to write them all in my code, do I? So, in order to prevent object copying of any kind, which of them should I use?
MyClass ( MyClass &) = delete;
MyClass (const MyClass &) = delete;
MyClass ( MyClass &&) = delete;
MyClass (const MyClass &&) = delete;
MyClass operator=( MyClass &) = delete;
MyClass operator=(const MyClass &) = delete;
const MyClass operator=( MyClass &) = delete;
const MyClass operator=(const MyClass &) = delete;
MyClass & operator=( MyClass &) = delete;
MyClass & operator=(const MyClass &) = delete;
const MyClass & operator=( MyClass &) = delete;
const MyClass & operator=(const MyClass &) = delete;
MyClass && operator=( MyClass &) = delete;
MyClass && operator=(const MyClass &) = delete;
const MyClass && operator=( MyClass &) = delete;
const MyClass && operator=(const MyClass &) = delete;
MyClass operator=( MyClass &&) = delete;
MyClass operator=(const MyClass &&) = delete;
const MyClass operator=( MyClass &&) = delete;
const MyClass operator=(const MyClass &&) = delete;
MyClass & operator=( MyClass &&) = delete;
MyClass & operator=(const MyClass &&) = delete;
const MyClass & operator=( MyClass &&) = delete;
const MyClass & operator=(const MyClass &&) = delete;
MyClass && operator=( MyClass &&) = delete;
MyClass && operator=(const MyClass &&) = delete;
const MyClass && operator=( MyClass &&) = delete;
const MyClass && operator=(const MyClass &&) = delete;
volatile
;-) – Tyburn