~/talk

Compile-Time Borrow Checker with Stateful Metaprogramming

Talkat C++Now 2026 · 2026-05-04..05-08· [compilers-and-language-design]
name:Alon Wolf
links:none on file
slides:none on file

Claim is that a Rust‑style borrow checker can run entirely at compile time in C++ by recording a MIR‑like IR via stateful metaprogramming and analyzing it with constexpr NLL algorithms. Implementation uses friend injection, a metastate recorder, expression‑proxy wrappers, liveness analysis, fixed‑point region inference and loan conflict checks; result is a ~1.5k‑line header‑only prototype that produces identical assembly and zero runtime cost but causes large compile‑time overhead and is practical only for small scopes today. Future C++26 reflection reduces boilerplate.

AI-written summary · about

  1. 0:00Memory safety and borrow checkers
  2. 10:02Borrow checker rules and lifetimes
  3. 17:11Stateful metaprogramming
  4. 29:55Compile-time borrow checker design
  5. 49:19Region inference and loan analysis
  6. 52:10Demo of borrow checker
  7. 1:00:38C++26 reflection for improvements
  8. 1:07:37Summary and applications
  9. 1:13:22Q&A
~/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.