Typical C++, But Why?
summary
Shows concrete patterns and code: a SanitizedString type that forces explicit construction so queries fail to compile instead of leaking unsanitized input; replaces boolean flag lists with enum class types for named options and to catch reordered or defaulted arguments; models start+length as a buffer_view (not raw pointer+len) to avoid overruns; uses a small must_init wrapper and config struct with member defaults/designated initializers so missing values become compile errors rather than subtle runtime bugs.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 1:46C++ type system metaphor
- 3:35Fixing argument bugs with strong types
- 11:59Eliminating boolean parameters
- 15:35Dangers of default parameters
- 20:16Buffer overflow and BufferView
- 28:59Config structs in C++20
- 35:00Strongly typed IDs
- 39:37Strong types beyond integers
- 42:27Evolving code with types
- 46:13Q&A
related talks
52mClasses C++23 Style
59mCute C++ Tricks, Part 2.5 of N - Code You Should Learn From & Never Write
01h 03mBack to Basics: Declarations in C++
01h 11mC++20 Templates: The next level: Concepts and more
54mA Tour of C++ Recognised User Type Categories
01h 04mC++ Concepts
01h 03mTemplates Made Easy with C++20
01h 03mTemplate Metaprogramming: Practical Application
