Compile-Time Validation in C++ Programming
Talkat CppCon 2024 · on Tuesday, 2024-09-17· at 15:15· Maple 3/4/5, 6700 North Gaylord Rockies Boulevard·
summary
Claims a practical system that records every compile-time action, validates lifetimes, borrows and pointer assignments, and reports errors at the call site using stateful metaprogramming and proxy types. Demonstrates compile-time unit tests, a borrow-rule, pointer and control-flow parsers (via macros), and a working demo that fails on invalid borrows across GCC Clang and MSVC. Shows how C++26 reflection and Circle compiler extensions simplify the approach and offers the early-stage MITSI header-only library on GitHub and Compiler Explorer.
AI-written summary · about
chapters (30)
- 0:00Introduction
- 0:31What is software validation
- 1:13Memory safety in C++
- 4:05Static vs runtime validation
- 6:12Early error detection
- 6:55Compile-time validation
- 8:19Static assert for errors
- 10:24Compile-time unit tests
- 11:26Enum validation with static checks
- 12:52C++ 26 reflection proposal
- 13:34Functional programming for validation
- 15:40Value wrappers for functions
- 17:03std::expected for validation
- 18:28Context variables and types
- 20:55Drawbacks of functional approach
- 22:37Compiler loophole for meta programming
- 27:12Function state validation
- 30:46Recording validation errors
- 32:08Borrow checking rules
- 34:41Control flow validation
- 38:15Live demo: compile-time validation
- 41:02Control flow cleanup checks
- 42:05Validation performance
- 44:37Error reporting benefits
- 45:41C++ 26 reflection future
- 47:28Compiler extensions for safety
- 50:01C++ safety evolution
- 51:47Safety beyond Rust
- 53:12MIT library plans
- 53:32Dedication to Mitsi
related talks
02h 02mPeering forward: C++'s next decade
23mFunctional Programming in C++ (Run time vs Compile time types)
01h 29mDelivering Safe C++
01h 03mC++ Reflection: Back on Track
01h 03mLifetime Safety in C++: Past, Present and Future
54mC++26: an overview
55mHow bad is meta-programming still today?
01h 30mC++ in Constrained Environments
