Template generic code

Template generic code 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

+
Create a template class for a fixed-size ring buffer. Name the header RingBuffer.h and implement…
Create a template class for a fixed-size ring buffer. Name the header RingBuffer.h and implement template<typename T, size_t N> class RingBuffer with methods Push(const T&), Pop(T& out), bool Empty() const, size_t Size() const, and void Clear(). Keep everything inline in the header so it instantiates for any T. Add brief comments for ownership semantics. Ladder":"L1"

Improve — make it easier to accept

+
Before I publish RingBuffer.h for other teams, make it easy to adopt and hard to misuse. Move…
Before I publish RingBuffer.h for other teams, make it easy to adopt and hard to misuse. Move safety checks to assertions, document behavior on overflow (overwrite oldest or reject), make iterator support optional, and show a short example of instantiating RingBuffer<int, 64>. Highlight performance characteristics and when a dynamic buffer is preferable. Ladder":"L2"

Decide — diagnose the stuck moment

+
Audio code compiles calls like buffer.Push(std::move(frame)); but instantiation errors complain…

I added RingBuffer<T,N> and templated code fails to instantiate for a specific type used by audio team

Audio code compiles calls like buffer.Push(std::move(frame)); but instantiation errors complain about missing copy constructor and ambiguous move. I’m uncertain whether to change Push to accept T&& or constrain the template with traits. I don’t know what the best practice is so I don’t break other users. Given this, which change will most likely fix the audio use case without regressing existing callers? Ladder":"L5"

Become — change the pattern

+
Across the codebase we reinvent fixed-size template containers with subtly different APIs. Each…

We keep writing slightly different template containers across modules and rework costs are high

Across the codebase we reinvent fixed-size template containers with subtly different APIs. Each copy causes later incompatibilities and extra test debt. What habit should we adopt to stop redundant templates, and what lightweight governance (templates registry, reference implementations, review checklist) will reduce duplication while staying flexible for domain needs? Ladder":"L6"

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.