Regina 7.4.1 Calculation Engine
compat.h File Reference

Helper functions for old compilers that do not properly support C++20. More...

Namespaces

namespace  regina
 Contains the entire Regina calculation engine.
 

Functions

template<typename Container >
std::strong_ordering regina::compat::lexCompare (const Container &a, const Container &b)
 Returns the lexicographical three-way comparison of the two given containers.
 

Detailed Description

Helper functions for old compilers that do not properly support C++20.

Function Documentation

◆ lexCompare()

template<typename Container >
std::strong_ordering regina::compat::lexCompare ( const Container & a,
const Container & b )

Returns the lexicographical three-way comparison of the two given containers.

The type Container should be a standard container type with begin() and end() functions. The comparison itself is equivalent to a <=> b. It is intended for use with old compilers that do not properly implement spaceship operators on containers such as std::vector or std::map.

It is assumed that the elements of these containers return a std::strong_ordering when compared.

Parameters
athe first of the two containers to compare.
bthe second of the two containers to compare.
Returns
the result of the lexicographical comparison a <=> b.