Template Struct comparison_operators

Struct Documentation

template<typename T>
struct comparison_operators

Supplement comparison operators when is_equal_to and is_less_than are defined. Make sure to provide them as protected functions to allow class hierarchies where every member uses this template.

Use with curiously recurring inheritance.

Public Functions

inline bool operator==(T const &other) const

Standard comparison operator; uses T::is_equal_to

inline bool operator<(T const &other) const

Standard comparison operator; uses T::is_less_than

inline bool operator!=(T const &other) const

Standard comparison operator; uses other operators.

inline bool operator>(T const &other) const

Standard comparison operator; uses other operators.

inline bool operator>=(T const &other) const

Standard comparison operator; uses other operators.

inline bool operator<=(T const &other) const

Standard comparison operator; uses other operators.