constexpr everything?!
summary
Claim: C++ is shifting from “some constexpr” to “constexpr everything,” driven by compiler interpreters that perform symbolic execution. Clang’s constant evaluator lives in constant.cpp ~17,000 lines and uses an APValue symbolic representation with pointer provenance, versions and allocation keys. Example: a helper calculate_size runs once at parse time while prepare_storage runs twice at runtime; std containers become largely constexpr by C++26, but raw byte-reinterpret casts and some object-layout tricks still block full evaluation.
AI-written summary · about
chapters (7)
- 0:00Introduction
- 7:55What constexpr means
- 13:13Compiler evaluation of constexpr
- 20:20Pointer provenance in constexpr
- 27:12Standard containers as constexpr
- 33:20Modern constexpr features and limits
- 35:50Future of constexpr
related talks
01h 00mHow To Use `constexpr` In C++23
01h 31mconsteval All The Things?
49mMy favorite (constexpr) data structures
01h 29mTesting Everything in Constexpr
50mC++ Costless Abstractions: the compiler view
54mC++ is a Metacompiler
01h 00mRemoving Metaprogramming From C++, Part 1 of N: constexpr Function Params
57mFast and Small - What are the Costs of Language Features
