//! @copyright *this file is freware. //! @warning Use it at your own risk. //! @file triplet.hpp //! @author Dejan D. M. Milosavljevic //! @version 1.0 //! @date 2003 //! @please "Do not remove or change this comments" //! @description triplet class. //! @bug //! @warning Use it at your own risk. //! @copyright *this file is freware. #ifndef _DDMRM_triplet_HPP_VERSION_1_0_ #define _DDMRM_triplet_HPP_VERSION_1_0_ #ifdef _WANT_DDMRM_names #define Dt_triplet GC_triplet #define Dt_S_standard S_standard #else #define Dt_triplet triplet #define Dt_S_standard stl_ext #endif namespace Dt_S_standard { template< typename _T1, typename _T2, typename _T3 > struct Dt_triplet { #ifdef _WANT_DDMRM_names typedef _T1 T_first; typedef _T2 T_second; typedef _T3 T_third; #else typedef _T1 first_type; typedef _T2 second_type; typedef _T3 third_type; #endif _T1 first; _T2 second; _T3 third; Dt_triplet() : first(_T1()), second(_T2()), third(_T3()) {} Dt_triplet( _T1 const& __a, _T2 const& __b, _T3 const& __c ) : first(__a), second(__b), third(__c) {} template Dt_triplet( Dt_triplet< _U1, _U2, _U3 > const& __p) : first(__p.first), second(__p.second ), third(__p.third ){ } template Dt_triplet& operator=( Dt_triplet<_U1,_U2,_U3> const& __x ) { first = __x.first; second = __x.second; third = __x.third; return *this; } }; template inline bool operator==(const Dt_triplet<_T1, _T2, _T3>& __x, const Dt_triplet<_T1, _T2, _T3>& __y) { return ( __x.first == __y.first ) && ( __x.second == __y.second ) && ( __x.third == __y.third ); } template inline bool operator!=(const Dt_triplet<_T1, _T2, _T3>& __x, const Dt_triplet<_T1, _T2, _T3>& __y) { return !( __x == __y ); } template inline bool operator<( Dt_triplet<_T1, _T2, _T3> const& __x, Dt_triplet<_T1, _T2, _T3> const& __y ) { return ( __x.first < __y.first ) || ( !(__y.first < __x.first ) && ( __x.second < __y.second ) ) || ( !(__y.first < __x.first ) && !( __x.second < __y.second ) && ( __x.third < __y.third ) ); } template inline bool operator>( Dt_triplet< _T1, _T2, _T3 > const& __x, Dt_triplet< _T1, _T2, _T3 > const& __y ) { return __y < __x; } template inline bool operator>=( Dt_triplet<_T1, _T2, _T3 > const& __x, Dt_triplet< _T1, _T2, _T3 >const& __y ) { return !(__x < __y); } template inline bool operator<=( Dt_triplet< _T1, _T2, _T3 > const& __x, Dt_triplet< _T1, _T2, _T3 > const& __y ) { return !(__y < __x); } template inline Dt_triplet<_T1, _T2, _T3> make_triplet( _T1 const& __x, _T2 const& __y, _T3 const& __z ) { return Dt_triplet<_T1, _T2, _T3>(__x, __y,__z); } }// namespace std_ext #undef Dt_triplet #undef Dt_S_standard #endif