Twelve posts of theory. Now we build. A complete, type-safe, zero-overhead domain-specific language — using every tool the compile-time language has taught us.
Posts tagged “metaprogramming” (6)
The compile-time language has arrays, maps, and linked lists. They just look nothing like their runtime counterparts — and they hold types instead of values.
In the compile-time language, types ARE the values. You pass them to functions, store them in data structures, and compute with them. This is the key insight that makes everything else click.
C++ isn't one language. It's two. One runs on your machine. The other runs inside the compiler. This series teaches the second one.
When your types carry enough information, the code writes itself. This is the endgame of C++ generics.
The best code is code that runs before your program starts. constexpr makes the compiler your runtime.