~/talk

Anything can be a Constexpr if you try hard enough

Talkat CppCon 2019 · 2019-09-15..09-20· [compilers-and-language-design]
links:none on file
slides:none on file

Shows a working constexpr implementation of std::array<T,0>::data() when T may not be default‑constructible, not just a theory. Starts from aligned char buffer and explains why reinterpret_cast and static_cast fail for constexpr or invoke UB, then uses Richard Smith’s union-with-bool-tag pattern to provide a constexpr constructor without default-constructing T. Fixes aggregate requirements by adding a container-wrapper-to-preserve-aggregate and exposes wrapper.T pointer as data, with code and slides on the CppCon 2019 repo.

AI-written summary · about

  1. 0:00Start
  2. 0:31THE PROBLEM
  3. 0:55THE SOLUTION
  4. 1:54WHY THE BOOL?
  5. 2:14THE CONSTEXPR SOLUTION
  6. 2:29THE FINAL PROGRAM
~/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.