containers/triple.hpp

    1: #ifndef STLPLUS_TRIPLE
    2: #define STLPLUS_TRIPLE
    3: ////////////////////////////////////////////////////////////////////////////////
    4: 
    5: //   Author:    Andy Rushton, from an original by Dan Milton
    6: //   Copyright: (c) Southampton University 1999-2004
    7: //              (c) Andy Rushton           2004-2008
    8: //   License:   BSD License, see ../docs/license.html
    9: 
   10: //   Similar to the STL pair but with three elements
   11: 
   12: ////////////////////////////////////////////////////////////////////////////////
   13: #include "containers_fixes.hpp"
   14: 
   15: namespace stlplus
   16: {
   17: 
   18:   ////////////////////////////////////////////////////////////////////////////////
   19:   // the triple class
   20: 
   21:   template<typename T1, typename T2, typename T3>
   22:   struct triple
   23:   {
   24:     typedef T1 first_type;
   25:     typedef T2 second_type;
   26:     typedef T3 third_type;
   27: 
   28:     T1 first;
   29:     T2 second;
   30:     T3 third;
   31: 
   32:     triple(void);
   33:     triple(const T1& p1, const T2& p2, const T3& p3);
   34:     triple(const triple<T1,T2,T3>& t2);
   35:   };
   36: 
   37:   ////////////////////////////////////////////////////////////////////////////////
   38:   // creation
   39: 
   40:   template<typename T1, typename T2, typename T3>
   41:   triple<T1,T2,T3> make_triple(const T1& first, const T2& second, const T3& third);
   42: 
   43:   ////////////////////////////////////////////////////////////////////////////////
   44:   // comparison
   45: 
   46:   template<typename T1, typename T2, typename T3>
   47:   bool operator == (const triple<T1,T2,T3>& left, const triple<T1,T2,T3>& right);
   48: 
   49:   ////////////////////////////////////////////////////////////////////////////////
   50: 
   51: } // end namespace stlplus
   52: 
   53: #include "triple.tpp"
   54: #endif