Classes C++23 Style
summary
Summary of concrete takeaways: prefer rule of zero for simple value types and implement the rule of five only when managing memory; build small resource wrappers that are deliberately move-only (example: a file wrapper that moves correctly) and use the new move-only function to hold callbacks; make as many APIs constexpr/constinit as possible and exploit transient compile-time allocations for validation; specialize std::formatter for types to enable std::print and use deducing this to replace cumbersome ref-qualified accessor overloads.
AI-written summary · about
chapters (19)
- 0:00C++23 class design
- 1:27Class lifecycle
- 4:56Rule of zero
- 8:08Rule of five
- 9:34Move-only wrappers
- 11:24Move-only functions
- 13:33Non-copyable non-movable types
- 14:58std::print output
- 15:40Value type comparisons
- 16:26Equality challenges
- 20:45Consteval compile-time
- 23:15const vs constinit
- 25:00Compile-time allocations
- 26:30Static_assert errors
- 28:59UB checking
- 30:01Formattable types
- 34:36Deducing this
- 42:26Summary
- 42:47Q&A
related talks
01h 03mBack to Basics: Declarations in C++
49mTypical C++, But Why?
01h 01mBack to Basics: Concepts in C++
54mA Tour of C++ Recognised User Type Categories
01h 00mDesigning Value Classes for Modern C++
59mCute C++ Tricks, Part 2.5 of N - Code You Should Learn From & Never Write
05mLightning Talks: -std=c++20 -- Will This C++ Code Compile?
58mGreat C++ is_trivial: trivial type traits
