This is C++: Uncompromised Performance, Undefined Behavior, & Move Semantics
summary
C++ prioritizes uncompromised performance by letting common operations compile to single machine instructions and putting corner cases off on undefined behavior, e.g. integer add/mul/div map to one instruction while a bounds-checked or "div_safe" version doubles cost and inserts a branch. std::vector::operator[] omits checks while at does not; std::list move constructors are not noexcept because sentinel nodes force allocations. Move semantics (since C++11) and a C++26 tweak to uninitialized int expose the debate; a partially formed moved-from model and a "move sanitizer" are proposed.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 2:03Uncompromised performance
- 10:54Undefined behavior
- 18:29Ecosystem and safety
- 25:42Move semantics
- 36:03Critique of standard design
- 47:45Partially formed objects
- 57:06Conclusion and Q&A
related talks
01h 23mThis is C++ - How to Use the C++ Superpower to Write Better C++ Code
55mBack to Basics: Move Semantics (part 1 of 2)
01h 00mThe Fine Details Behind C++ Containers And Algorithms
53mC++ Features You Might Not Know
01h 27mDangerous Optimizations! in C++ - Part Deux
51mC++ Features You Might Not Know
05mMoving an `int` Is Slow: Debug Performance Matters!
01h 04mRemoving Needless Undefined Behavior for a Safer C++
