5 template <
typename DERIVED>
8 virtual int compareTo(
const DERIVED &other)
const = 0;
9 bool operator==(
const DERIVED &other)
const;
10 bool operator!=(
const DERIVED &other)
const;
11 bool operator<(
const DERIVED &other)
const;
12 bool operator>(
const DERIVED &other)
const;
13 bool operator<=(
const DERIVED &other)
const;
14 bool operator>=(
const DERIVED &other)
const;
18 template<
typename DERIVED>
19 auto comparable<DERIVED>::operator==(
const DERIVED &other)
const ->
bool {
20 return compareTo(other) == 0;
23 template<
typename DERIVED>
24 auto comparable<DERIVED>::operator!=(
const DERIVED &other)
const ->
bool {
25 return compareTo(other) != 0;
28 template<
typename DERIVED>
29 auto comparable<DERIVED>::operator<(
const DERIVED &other)
const ->
bool {
30 return compareTo(other) < 0;
33 template<
typename DERIVED>
34 auto comparable<DERIVED>::operator>(
const DERIVED &other)
const ->
bool {
35 return compareTo(other) > 0;
38 template<
typename DERIVED>
39 auto comparable<DERIVED>::operator<=(
const DERIVED &other)
const ->
bool {
40 return compareTo(other) <= 0;
43 template<
typename DERIVED>
44 auto comparable<DERIVED>::operator>=(
const DERIVED &other)
const ->
bool {
45 return compareTo(other) >= 0;
Definition comparable.h:6