Regina Calculation Engine
|
An adaptable binary function used to compare the objects to which pointers are pointing. More...
#include <utilities/ptrutils.h>
Public Types | |
typedef const T * | first_argument_type |
The first argument type for this binary function. More... | |
typedef const T * | second_argument_type |
The second argument type for this binary function. More... | |
typedef bool | result_type |
The result type for this binary comparison function. More... | |
Public Member Functions | |
bool | operator() (const T *ptr1, const T *ptr2) const |
Compares the objects to which the given pointers are pointing. More... | |
An adaptable binary function used to compare the objects to which pointers are pointing.
This class is for use with the Standard Template Library.
The first template argument T will generally not be a pointer class. Instead, this function will accept two const pointers to T. It will then dereference these pointers and compare these dereferenced objects using the given comparison function (which defaults to std::less, but which can be changed by passing a different second template argument).
typedef const T* regina::LessDeref< T, Comp >::first_argument_type |
The first argument type for this binary function.
typedef bool regina::LessDeref< T, Comp >::result_type |
The result type for this binary comparison function.
typedef const T* regina::LessDeref< T, Comp >::second_argument_type |
The second argument type for this binary function.
|
inline |
Compares the objects to which the given pointers are pointing.
The two pointers are dereferenced, and then a function of type Comp (the second template argument) is used to compare the dereferenced objects.
ptr1 | a pointer to the first object under examination. |
ptr2 | a pointer to the second object under examination. |
true
if the first dereferenced object is less than the second, or false
otherwise.