LexicographicalCompare

template<typename T>
struct libsemigroups::LexicographicalCompare

Defined in order.hpp.

A stateless struct with binary call operator using std::lexicographical_compare.

This only exists to be used as a template parameter, and has no advantages over using std::lexicographical_compare otherwise.

Template Parameters

T – the type of the objects to be compared.

Public Functions

inline bool operator()(T const &x, T const &y) const

Call operator that compares x and y using std::lexicographical_compare.

Complexity

See std::lexicographical_compare.

Parameters
  • x – const reference to the first object for comparison

  • y – const reference to the second object for comparison

Throws

(None) – See std::lexicographical_compare.

Returns

A bool.

template<typename S>
inline bool operator()(S first1, S last1, S first2, S last2) const

Call operator that compares iterators using std::lexicographical_compare.

Complexity

See std::lexicographical_compare.

Parameters
  • first1 – the start of the first object to compare

  • last1 – one beyond the end of the first object to compare

  • first2 – the start of the second object to compare

  • last2 – one beyond the end of the second object to compare

Throws

(None) – See std::lexicographical_compare.

Returns

A bool.