Implement operator overloads

Implement operator overloads 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 have a math vector class used across the renderer and physics. Implement operator+ and operator+=…
I have a math vector class used across the renderer and physics. Implement operator+ and operator+= so adding vectors is consistent. Make operator+ call operator+= internally, ensure exception safety, and preserve component-wise semantics. Add tests showing both operators for temporary and lvalue operands. Ladder L1

Improve — make it easier to accept

+
Before I expose arithmetic operators on the vector type to the rest of the engine, make the…
Before I expose arithmetic operators on the vector type to the rest of the engine, make the interface easy to review by the physics lead. Show the public signatures up front, ensure operator+ does not allocate, document value-category effects, and flag any conversions that could be implicit and surprising to a reviewer. Ladder L2

Decide — diagnose the stuck moment

+
I attempted to use my Vector class with code that does position = velocity + acceleration * dt and…

I tried compiling code that uses vector + temporary and got ambiguous overloads

I attempted to use my Vector class with code that does position = velocity + acceleration * dt and the compiler reports ambiguous overloads between operator+ and a templated free function. I cannot tell which overload the caller expects and whether temporaries will be moved. What is the likely cause and what minimal changes should I make so addition is unambiguous, efficient for temporaries, and safe for the physics code? Ladder L5

Become — change the pattern

+
Across the codebase we have several small math types with slightly different operator overload…

We keep getting subtle bugs from inconsistent operator overloads across math types

Across the codebase we have several small math types with slightly different operator overload patterns; some use member operator+, others free functions, and some return by value while others return proxies. This causes ambiguous calls and performance cliffs. What habit should the team adopt for operator overloads, how to refactor gradually, and what tests or code-review rules will prevent the class of bugs going forward? 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.