MCPcopy Create free account
hub / github.com/SimHacker/micropolis / operator<

Function operator<

MicropolisCore/src/MicropolisEngine/src/position.h:176–180  ·  view source on GitHub ↗

* Less-than comparison on positions (needed for map since Position is used as * key value). * @param pos1 First position. * @param pos2 Second position. * @return First position is smaller than second position. */

Source from the content-addressed store, hash-verified

174 * @return First position is smaller than second position.
175 */
176inline bool operator<(const Position &pos1, const Position &pos2)
177{
178 if (pos1.posX != pos2.posX) return pos1.posX < pos2.posX;
179 return pos1.posY < pos2.posY;
180}
181
182#endif
183

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected