CppCon 2017: Ben Deane & Jason Turner “constexpr ALL the Things!”

CppCon · 61K views · 2017 · 1:10:13

Open on YouTube

C, C++, Rust, Go & systems languagesProgramming language designtalk

Why Stack Overflow recommends it

Stack Overflow users link it when answering questions about constexpr containers, string parsing and compile-time computation, and as the go-to talk for the 'constexpr all the things' idea.

Recommended by 3 people across 3 different months, 2017 to 2025.

What it is

A CppCon 2017 talk by Ben Deane and Jason Turner on how far C++17 constexpr can go. They show how to build constexpr data structures, algorithms and user-defined-literal abstractions, culminating in an experimental compile-time JSON parser.

What people said

Recommends Julius · 2017-10 · Stack Overflow · on “How to create a constexpr list?”

Or have a look at this constexpr JSON parser [LINK] . Recorded presentations are available on Youtube from C++Now 2017 [LINK] and (more recently) CppCon 2017 [this video] .

Recommends jan.sende · 2018-08 · Stack Overflow · on “constexpr exp, log, pow”

This is a current shortcoming of the c++ standard. Most of the functions (especially in ` ` and ` `) could be `constexpr`, but no one came around to fix the wording in the standard, and the corresponding libraries yet. By the way, have a look at constexpr ALL the Things [this video] , they don't solve your problem, but discuss general solutions to `constexpr` stuff.

Recommends Julius · 2018-08 · Stack Overflow · on “C++17 constexpr string parsing”

You may be interested in the experimental **`constexpr` JSON parser** by Ben Deane and Jason Turner. Their experiments are titled *constexpr all the things*. There have been talks at C++Now 2017 [LINK] ( [LINK] ) and CppCon 2017 [LINK] ( [this video] ). The source code is on GitHub [LINK] , but I recommend watching the talk.

Recommends Enlico · 2025-08 · Stack Overflow · on “Why should I be careful in "noexcept-ing all the functions" just like I "const all the things"?”

I haven't found a video about const all the things ¹, but there's at least Con.3: By default, pass pointers and references to consts from the Cpp Core Guidelines [LINK] . There's lots of presentations and other resources suggesting to constexpr all the things , e.g. CppCon 2017: Ben Deane & Jason Turner “constexpr ALL the Things!” [this video] ², but that, as suggested in the comments, doesn't really parallel either of const or noexcept , because it does not alter the interface of a function, but just adds extra functionality. But as far noexcept goes, I don't seem to find as much "enthusiasm". The suggestions are more often skewed towards being very careful with it: noexcept is tricky, as it is

Cites Max Langhof · 2019-01 · Stack Overflow · on “What is the reason to extend "undefined behaviour" over the compilation phase?”

Consider this: C++ compilers can (e.g. constexpr ALL the things! [this video] ) and, to some degree, always have been doing optimizations/calculations at compile-time. It should not be surprising that something that leads to UB while running some compiled C++ code can also lead to UB when done at compile-time. To summarize the comments below: C++ basically always had (compile-time) optimizations. UB helps optimizations in that the compiler is free to assume no UB is present for proving the validity of its optimizations. Compiler writers are not required to ensure their optimizations (for code generation or for constexpr evaluation or anything in between) detect or are robust in the face of UB. He

Cites Nick · 2021-09 · Stack Overflow · on “What's a good way to store a small, fixed size, hierarchical set of static data?”

If you haven't already, you might want to look at this: [LINK] and the presentation that went with it: [this video] I came across this in my own search for answers, but I haven't gone through the code yet. It's an attempt at making a `constexpr` JSON (style) tree and parser in C++.