NAME

OTC_Pair - Template class for encapsulating a pair of values.

SYNOPSIS


#include <OTC/collctn/pair.hh>

template<class T1, class T2>
class OTC_Pair : public OTC_MPObject
{
  public:
    static os_typespec* get_os_typespec();
    inline OTC_Pair(T1 const& theFirst, T2 const& theSecond);
    inline OTC_Pair(OTC_Pair<T1,T2> const& thePair);
    inline OTC_Pair<T1,T2>& operator=(OTC_Pair<T1,T2> const& thePair);
    inline T1 const& first() const;
    inline T1& first();
    inline T2 const& second() const;
    inline T2& second();
};

CLASS TYPE

Concrete

DESCRIPTION

The OTC_Pair class can be used to encapsulate a pair of simple values. This facilitates returning of a pair of values from a function. The class also allows allocation of a pair of objects in the common memory pool.

INITIALISATION

inline OTC_Pair(T1 const& theFirst, T2 const& theSecond);
inline OTC_Pair(OTC_Pair<T1,T2> const& thePair);

ASSIGNMENT

inline OTC_Pair<T1,T2>& operator=(OTC_Pair<T1,T2> const& thePair);

ACCESS

inline T1 const& first() const;
inline T1& first();
inline T2 const& second() const;
inline T2& second();

SEE ALSO

OTC_Single, OTC_Triple

LIBRARY

OTC

AUTHOR(S)

Graham Dumpleton

COPYRIGHT

Copyright 1993 TELSTRA CORPORATION LIMITED