Write template metaprogramming

Write template metaprogramming in C++ — with the four heights of help laid out: do it now, make it easier for the next person to accept, work out the right move when you are stuck, and learn the pattern so it stops coming back.

4prompt heights
Open it in the interactive atlas →

The four heights

The same task, four distances: today's deadline, the next reviewer, the stuck moment, the pattern.

Execute — do the immediate task

+
I need a header-only template that computes a compile-time factorial for unsigned integers up to 20…
I need a header-only template that computes a compile-time factorial for unsigned integers up to 20 and provides a constexpr function wrapper for runtime use. Make sure the meta-recursive instantiation stops properly and produces a readable static_assert failure when given a negative or too-large value. Include brief usage examples showing compile-time and runtime calls on line numbers matching the declarations.

Improve — make it easier to accept

+
Before I commit this metaprogram to the library, make it easy for reviewers to accept: surface the…
Before I commit this metaprogram to the library, make it easy for reviewers to accept: surface the maximum supported input (20) at the top, show the compile-time vs runtime API side-by-side, flag where template instantiation could be expensive, and point out the simplest change to generalize to arbitrary integer types.

Decide — diagnose the stuck moment

+
I wrote a constexpr factorial template and the CI is failing for inputs >20 with a cryptic template…

I just pushed a header that fails on static_assert with big numbers

I wrote a constexpr factorial template and the CI is failing for inputs >20 with a cryptic template error. I need to tell the reviewer what I changed, which tests I ran, and what I fear: that making the bound looser will cause long compile times or overflow. What is the likely diagnosis and the safest next move to fix the failure while keeping compile-time diagnostics clear?

Become — change the pattern

+
Across several utilities I keep duplicating the same pattern: inline constexpr limits, recursive…

I keep rewriting small constexpr utilities with different guard styles

Across several utilities I keep duplicating the same pattern: inline constexpr limits, recursive metafunctions, and ad hoc static_assert messages. This costs review time and causes inconsistent diagnostics. Which habit should I adopt to stop replaying this rework: suggest a single header convention, a compact macro or alias pattern, and one clear rule for test coverage that reduces future churn.

Next to this one

Other programming language work people do in C++.

Every task here came from the work, not from a feature list — which is why the prompts name what you want done and never the button that does it. The tool changes; the work does not.
Copyright © LLOS.ai · 2026 — original pedagogy, voice, and design — all rights reserved.

The rest of the map

Same library, five ways in.