OrderedPair< T > Class Template Reference

OrderedPair holds two objects of the same arbitrary type. More...

#include <OrderedPair.h>

List of all members.

Public Types

typedef T Value
 The value type.
typedef Loki::TypeTraits
< Value >::ParameterType 
ParameterType
 The const parameter type.
typedef std::pair< T, T > Base
 The base type is a pair.

Public Member Functions

void order ()
 Order the two elements.
Constructors etc.

 OrderedPair ()
 Default constructor.
 OrderedPair (const OrderedPair &other)
 Copy constructor.
OrderedPairoperator= (const OrderedPair &other)
 Assignment operator.
 ~OrderedPair ()
 Trivial destructor.
 OrderedPair (const Value &a, const Value &b)
 Construct by copying the elements.
template<typename T1 , typename T2 >
 OrderedPair (const std::pair< T1, T2 > &x)
 Construct from a pair of different types.
Accessors.

ParameterType getFirst () const
 Return the first element.
ParameterType getSecond () const
 Return the second element.
Manipulators.

void set (ParameterType x, ParameterType y)
 Set the elements.
void setFirst (ParameterType x)
 Set the first element.
void setSecond (ParameterType x)
 Set the second element.

Detailed Description

template<typename T>
class OrderedPair< T >

OrderedPair holds two objects of the same arbitrary type.

The objects are ordered so that the first precedes the second.


Constructor & Destructor Documentation

template<typename T>
OrderedPair< T >::OrderedPair (  )  [inline]

Default constructor.

Create the elements using their default constructors.


Member Function Documentation

template<typename T>
void OrderedPair< T >::set ( ParameterType  x,
ParameterType  y 
) [inline]

Set the elements.

Note:
The elements may be swapped.
template<typename T>
void OrderedPair< T >::setFirst ( ParameterType  x  )  [inline]

Set the first element.

Note:
This this may cause the first and second element to be swapped.
template<typename T>
void OrderedPair< T >::setSecond ( ParameterType  x  )  [inline]

Set the second element.

Note:
This this may cause the first and second element to be swapped.

The documentation for this class was generated from the following file:
Generated on Thu Jun 30 02:14:52 2016 for Algorithms and Data Structures Package by  doxygen 1.6.3