On Sunday, 22 May 2022 21:12:52 PDT Edward Catmur wrote:
> > If the mechanism is opt-out per type, then libc++ will opt out
> > std::unique_ptr in the standard Library headers
>
> Why would they opt-out?
>
> To preserve (function argument passing) ABI.
That of course means the standard can't mandate that the operator be present
or it must allow the observable behaviour of using move+destroy instead of
relocating on the implementation's choice.
The latter. It's the duty of the class author to ensure that the two have no observable difference in behavior, just as they have a duty to ensure that copy elision (NRVO, etc) does not in practice change the observable behavior of the program. Any class where there is a difference is either being used for debugging, for teaching, or is pathological. For std::unique_ptr there is no observable difference, unless the deleter is pathological, which std::default_delete is not.