Copy construction and assignment have been explicitly forbidden by the author.
If it is used externally, it will be an error (because it is private
). If it is referenced internally or by a friend
, then it will produce a link error because the definition does not exist.
In C++11, this is more clearly written as:
MyClass(const MyClass&) = delete;
MyClass& operator=(const MyClass&) = delete;
Here, the compiler will note this at compilation - no linker errors and clear intent without additional documentation :)