A phantom type parameter exists only in the type system — it carries no data, occupies no memory, and vanishes in the binary. Parametricity guarantees it works. Representation independence makes it free.
Posts tagged “templates” (7)
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.
How Loom encodes routes as non-type template parameters, analyzes patterns at compile time, and generates an optimal dispatch chain with zero runtime overhead.
How Loom turns HTML generation into composable C++ expressions with a fold-based DOM builder, control flow primitives, and a JSX-like component system with theme-overridable slots.
How Loom uses phantom type tags, conditional concepts, structural enums, and token types to turn entire categories of bugs into compile errors.
A fold expression is a loop that runs at compile time, generating exactly the code you need and nothing more.
Templates aren't generics. They're a code generation system disguised as a type system feature.