Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

LibTriple.h

00001             /********************** LibTriple.h **********************/
00002 
00003 #ifndef LIB_TRIPLE_H
00004 #define LIB_TRIPLE_H
00005 
00013 namespace libtriple {
00014 
00018 template <class _T1, class _T2, class _T3>
00019 struct triple {
00020   typedef _T1 first_type;
00021   typedef _T2 second_type;
00022   typedef _T3 third_type;
00023   _T1 first;
00024   _T2 second;
00025   _T3 third;
00026 
00027   triple() : first(_T1()), second(_T2()), third(_T3()) {}
00028   triple(const _T1 __a, const _T2 __b, const _T3 __c) : first(__a), second(__b), third(__c) {}
00029 };
00030 
00039 template <class _T1, class _T2, class _T3>
00040 inline bool operator==(const triple<_T1, _T2, _T3>& __x, const triple<_T1, _T2, _T3>& __y)
00041 {
00042   return __x.first == __y.first && __x.second == __y.second && __x.third == __y.third; 
00043 }
00044 
00053 template <class _T1, class _T2, class _T3>
00054 inline bool operator<(const triple<_T1, _T2, _T3>& __x, const triple<_T1, _T2, _T3>& __y)
00055 { 
00056   return __x.first < __y.first || 
00057     (!(__y.first  < __x.first)  && __x.second < __y.second) ||
00058     (!(__y.second < __x.second) && __x.third  < __y.third); 
00059 }
00060 
00069 template <class _T1, class _T2, class _T3>
00070 inline triple<_T1, _T2, _T3> make_triple(const _T1& __x, const _T2& __y, const _T3& __z)
00071 {
00072   return triple<_T1, _T2, _T3>(__x, __y, __z);
00073 }
00074 
00075 }//end of namespace libtriple
00076 #endif 
00077 

Generated on Tue Oct 5 14:42:45 2004 for LCG Information System Interface by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002