Should you explicitly delete unused/unsupported special functions or declare them as private?
Show answer and explanation
Prefer a public deleted declaration: it states the unsupported operation in the interface and gives a direct compile-time diagnostic regardless of access context. A private undeclared function is a pre-C++11 technique with less precise behavior and diagnostics.
Prefer a public deleted declaration: it states the unsupported operation in the interface and gives a direct compile-time diagnostic regardless of access context. A private undeclared function is a pre-C++11 technique with less precise behavior and diagnostics.
Connect the conclusion directly to the type, lifetime, ownership, overload-resolution rule, or library contract present in the question. State implementation dependence or a violated precondition explicitly instead of merely guessing output.