Typical C++, but Why?
summary
Shows concrete refactors that stop real bugs: replace plain strings with a sanitized_string type (private data, throwing explicit ctor and explicit conversion to avoid using unsanitized input), swap boolean flag lists for distinct enum class flag types, consolidate pointer+length into a buffer_view over std::span to prevent offset overflow, and require values with a must_init<T> wrapper to force initialization. Examples compile-time fail instead of producing runtime errors.
AI-written summary · about
chapters (16)
- 0:00Introduction
- 0:38Jigsaw puzzle analogy
- 1:20Strength of strong typing
- 2:31Goal of the presentation
- 3:32Data sanitization example
- 6:28Implicit conversions
- 10:17Enum class for flags
- 14:08Avoiding default dangers
- 17:30Structuring arguments
- 19:01Buffer views for memory
- 25:41Named initialization
- 30:14Forcing initialization
- 33:31Configuration structures
- 36:24Type safety for IDs
- 44:28Conclusion
- 49:05Recommendations








