libmoost
|
Sub-class this to implement relops in your class. More...
#include <relops.hpp>
Public Member Functions | |
template<typename U > | |
bool | operator== (U const &rhs) const |
Equality operator. | |
template<typename U > | |
bool | operator< (U const &rhs) const |
Less-than operator. | |
template<typename U > | |
bool | operator!= (U const &rhs) const |
In-equality operator. | |
template<typename U > | |
bool | operator> (U const &rhs) const |
Greater-than operator. | |
template<typename U > | |
bool | operator<= (U const &rhs) const |
Less-than or equal. | |
template<typename U > | |
bool | operator>= (U const &rhs) const |
Greater-than or equal operator. | |
Protected Member Functions | |
relops () | |
Friends | |
template<typename U > | |
bool | operator== (U const &lhs, T const &rhs) |
template<typename U > | |
bool | operator< (U const &lhs, T const &rhs) |
template<typename U > | |
bool | operator!= (U const &lhs, T const &rhs) |
template<typename U > | |
bool | operator> (U const &lhs, T const &rhs) |
template<typename U > | |
bool | operator<= (U const &lhs, T const &rhs) |
template<typename U > | |
bool | operator>= (U const &lhs, T const &rhs) |
Sub-class this to implement relops in your class.
T | The type being compared |
This framework isn't meant as a replacement for the Boost operators library; rather, it serves the single job of making the addition of relationship operators to a class as trivial as possible. Your class just exposes '==' and '<' and then sub-classs relops<T>. It will then get support for all relationship operators, both ways.
ie. X cmp Y and Y cmp X (where cmp is a relationship operator)
Definition at line 60 of file relops.hpp.
moost::utils::relops< T >::relops | ( | ) | [inline, protected] |
Definition at line 63 of file relops.hpp.
bool moost::utils::relops< T >::operator!= | ( | U const & | rhs | ) | const [inline] |
In-equality operator.
rhs | The right hand side value |
Definition at line 124 of file relops.hpp.
bool moost::utils::relops< T >::operator< | ( | U const & | rhs | ) | const [inline] |
Less-than operator.
rhs | The right hand side value |
Definition at line 100 of file relops.hpp.
bool moost::utils::relops< T >::operator<= | ( | U const & | rhs | ) | const [inline] |
Less-than or equal.
rhs | The right hand side value |
Definition at line 170 of file relops.hpp.
bool moost::utils::relops< T >::operator== | ( | U const & | rhs | ) | const [inline] |
Equality operator.
rhs | The right hand side value |
Definition at line 77 of file relops.hpp.
bool moost::utils::relops< T >::operator> | ( | U const & | rhs | ) | const [inline] |
Greater-than operator.
rhs | The right hand side value |
Definition at line 147 of file relops.hpp.
bool moost::utils::relops< T >::operator>= | ( | U const & | rhs | ) | const [inline] |
Greater-than or equal operator.
rhs | The right hand side value |
Definition at line 193 of file relops.hpp.
bool operator!= | ( | U const & | lhs, |
T const & | rhs | ||
) | [friend] |
Definition at line 130 of file relops.hpp.
bool operator< | ( | U const & | lhs, |
T const & | rhs | ||
) | [friend] |
Definition at line 107 of file relops.hpp.
bool operator<= | ( | U const & | lhs, |
T const & | rhs | ||
) | [friend] |
Definition at line 176 of file relops.hpp.
bool operator== | ( | U const & | lhs, |
T const & | rhs | ||
) | [friend] |
Definition at line 84 of file relops.hpp.
bool operator> | ( | U const & | lhs, |
T const & | rhs | ||
) | [friend] |
Definition at line 153 of file relops.hpp.
bool operator>= | ( | U const & | lhs, |
T const & | rhs | ||
) | [friend] |
Definition at line 199 of file relops.hpp.