~/talk

consteval All The Things?

Talkat ACCU 2025 · 2025-04-01..04-04· [c-and-cpp]
slides:none on file

Consteval is a C++20 tool that forces compile-time evaluation but also requires arguments to be constant expressions, so ordinary function parameters are never constant expressions and many calls fail to compile. Examples: consteval constructors and implicit conversions make a string_view impossible to dangle; consteval lambdas and UDLs let parsing fail at compile time; defaulted consteval constructors shrink debug binaries. Downsides: no emitted code to debug, sanitizers and fuzzers don’t apply, and compilers (GCC vs Clang) behave differently. Testing strategy uses dual-compilation with static_asserts and runtime builds.

AI-written summary · about

  1. 0:00Introduction and background
  2. 3:22In memory of Rainer Grimm
  3. 4:58Constexpr and compile time
  4. 8:20Constant evaluation rules
  5. 21:02Understanding constinit
  6. 23:20The role of consteval
  7. 32:31Constant evaluation and UB
  8. 44:10If constexpr vs. if consteval
  9. 50:41Consteval constructors
  10. 56:04Consteval member functions
  11. 1:04:06Consteval special members
  12. 1:16:24Consteval UDLs and functions
  13. 1:22:22Testing and debugging consteval
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.