“How to Write Well-Behaved Value Wrappers”
summary
Shows how implementing wrappers like std::optional or pair actually breaks or costs performance: missing noexcept makes std::vector turn moves into copies (example: 100k copies vs ~200k moves), hand-rolling comparison overloads disappears with operator<=>, explicit-converting constructors need conditional explicitness (C++20 fixes), conditional deletion and triviality require base-class work today to preserve register passing, and the deducing this proposal fixes SFINAE-unfriendly callables and ref-qualified accessors.
AI-written summary · about
