C++ WAT
summary
A rapid survey of concrete C++ gotchas showing code that compiles but does unexpected things: operator[] as pointer arithmetic makes a map look like an int; trigraphs and digraphs change string output; calling a destructor on an int expression is valid; realloc UB makes two pointers seem equal under clang; undefined behavior lets the optimizer replace table scans or infinite loops with constant returns; brace init turns vector<string> constructors into iterator overloads and can crash; a template trick makes a function impossible to call.
AI-written summary · about
chapters (16)
- 0:00Intro
- 0:44Does it compile
- 1:28Code without comments
- 2:42Trycatch block
- 3:17Example
- 4:00Destructor
- 4:39Undefined behaviour
- 6:02Quantum language
- 6:34Function calls
- 7:03Undefined behavior
- 8:27Infinite loop
- 9:29Why does it compile
- 10:36GDB
- 11:12Braces
- 12:01Construct
- 12:56One minute more
related talks
51mC++ Features You Might Not Know
53mC++ Features You Might Not Know
29mC++ Cryptozoology - A Compendium of Cryptic Characters
56mCute C++ Tricks (and what you can learn from them): Part 2 of N
52mC++ Puzzlers
54mTypical C++, But Why?
17mC++ Cryptozoology - A Compendium of Cryptic Characters
19mLightning Talk: Your Favorite Undefined Behavior in C++
