Regina Calculation Engine
Public Types | Public Member Functions | List of all members
regina::LessDeref< T, Comp > Class Template Reference

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...
 

Detailed Description

template<typename T, typename Comp = std::less<T>>
class regina::LessDeref< T, Comp >

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).

Python:
Not present.

Member Typedef Documentation

template<typename T , typename Comp = std::less<T>>
typedef const T* regina::LessDeref< T, Comp >::first_argument_type

The first argument type for this binary function.

template<typename T , typename Comp = std::less<T>>
typedef bool regina::LessDeref< T, Comp >::result_type

The result type for this binary comparison function.

template<typename T , typename Comp = std::less<T>>
typedef const T* regina::LessDeref< T, Comp >::second_argument_type

The second argument type for this binary function.

Member Function Documentation

template<typename T , typename Comp = std::less<T>>
bool regina::LessDeref< T, Comp >::operator() ( const T *  ptr1,
const T *  ptr2 
) const
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.

Parameters
ptr1a pointer to the first object under examination.
ptr2a pointer to the second object under examination.
Returns
true if the first dereferenced object is less than the second, or false otherwise.

The documentation for this class was generated from the following file:

Copyright © 1999-2013, The Regina development team
This software is released under the GNU General Public License, with some additional permissions; see the source code for details.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@debian.org).