Instantiate template classes

Instantiate template classes 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

+
Instantiate our template EntityPool for the gameplay module. Create a header GameEntities.h that…
Instantiate our template EntityPool for the gameplay module. Create a header GameEntities.h that declares using BulletPool = EntityPool<Bullet, 1024>; extern BulletPool g_bullets; and ensure GameEntities.cpp defines BulletPool g_bullets; so the pool is shared across translation units. Confirm Bullet type is forward-declared in the header and the full include is only in the cpp. Ladder":"L1"

Improve — make it easier to accept

+
Before I expose g_bullets, make it easy for reviewers to see ownership and lifetime. Surface why we…
Before I expose g_bullets, make it easy for reviewers to see ownership and lifetime. Surface why we chose a global instance over passing references, document thread-safety expectations, explain why 1024 was chosen, and flag what must change to turn it into a dependency-injected pool for unit tests. Ladder":"L2"

Decide — diagnose the stuck moment

+
Tests that create and destroy worlds report use-after-free during shutdown. I suspect global…

I instantiated EntityPool<Bullet,1024> in GameEntities.cpp and tests now randomly crash during teardown

Tests that create and destroy worlds report use-after-free during shutdown. I suspect global g_bullets outlives some systems or the Bullet type has non-trivial destructors that run in the wrong order. I can’t tell which subsystem’s static destructors run earlier. Should I convert the global instance to a function-local static, or change teardown ordering? Which is the safer first change to stabilize tests? Ladder":"L5"

Become — change the pattern

+
Many modules create global instantiated template pools and we get intermittent test flakes and…

We rely on template singletons and suffer flaky tests and teardown ordering issues

Many modules create global instantiated template pools and we get intermittent test flakes and shutdown order problems. What consistent pattern should we adopt to manage lifetime and testability of instantiated template globals, and what small migration steps will make the code safer with minimal churn? 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.