00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 
00035 
00036 
00037 
00038 
00039 
00040 
00047 #ifndef STLSOFT_INCL_STLSOFT_UTIL_HPP_PAIR
00048 #define STLSOFT_INCL_STLSOFT_UTIL_HPP_PAIR
00049 
00050 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00051 # define STLSOFT_VER_STLSOFT_UTIL_HPP_PAIR_MAJOR     5
00052 # define STLSOFT_VER_STLSOFT_UTIL_HPP_PAIR_MINOR     0
00053 # define STLSOFT_VER_STLSOFT_UTIL_HPP_PAIR_REVISION  2
00054 # define STLSOFT_VER_STLSOFT_UTIL_HPP_PAIR_EDIT      54
00055 #endif 
00056 
00057 
00058 
00059 
00060 
00061 #ifndef STLSOFT_INCL_STLSOFT_H_STLSOFT
00062 # include <stlsoft/stlsoft.h>
00063 #endif 
00064 
00065 
00066 
00067 
00068 
00069 #ifndef _STLSOFT_NO_NAMESPACE
00070 namespace stlsoft
00071 {
00072 #endif 
00073 
00074 
00075 
00076 
00077 
00085 template<   ss_typename_param_k T1
00086         ,   ss_typename_param_k T2
00087         >
00088 struct pair
00089 {
00090 public:
00092     typedef T1      first_type;
00094     typedef T2      second_type;
00095 
00098 public:
00100     pair()
00101         : first(first_type())
00102         , second(second_type())
00103     {}
00105     pair(first_type const& v1, second_type const& v2)
00106         : first(v1)
00107         , second(v2)
00108     {}
00110 
00113 public:
00114     first_type  first;  
00115     second_type second; 
00116 
00117 };
00118 
00119 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00120 
00121 template<ss_typename_param_k T1, ss_typename_param_k T2>
00122 inline ss_bool_t operator ==(pair<T1, T2> const& x, pair<T1, T2> const& y)
00123 {
00124     return x.first == y.first && x.second == y.second;
00125 }
00126 
00127 template<ss_typename_param_k T1, ss_typename_param_k T2>
00128 inline ss_bool_t operator !=(pair<T1, T2> const& x, pair<T1, T2> const& y)
00129 {
00130     return !(x == y);
00131 }
00132 
00133 template<ss_typename_param_k T1, ss_typename_param_k T2>
00134 inline ss_bool_t operator <(pair<T1, T2> const& x, pair<T1, T2> const& y)
00135 {
00136     return x.first < y.first || !(y.first < x.first) && x.second < y.second;
00137 }
00138 
00139 template<ss_typename_param_k T1, ss_typename_param_k T2>
00140 inline ss_bool_t operator >(pair<T1, T2> const& x, pair<T1, T2> const& y)
00141 {
00142     return y < x;
00143 }
00144 
00145 template<ss_typename_param_k T1, ss_typename_param_k T2>
00146 inline ss_bool_t operator <=(pair<T1, T2> const& x, pair<T1, T2> const& y)
00147 {
00148     return !(y < x);
00149 }
00150 
00151 template<ss_typename_param_k T1, ss_typename_param_k T2>
00152 inline ss_bool_t operator >=(pair<T1, T2> const& x, pair<T1, T2> const& y)
00153 {
00154     return !(x < y);
00155 }
00156 
00157 template<ss_typename_param_k T1, ss_typename_param_k T2>
00158 inline pair<T1, T2> make_pair(T1 const& x, T2 const& y)
00159 {
00160     return pair<T1, T2>(x, y);
00161 }
00162 
00163 #endif 
00164 
00166 
00167 
00168 #ifdef STLSOFT_UNITTEST
00169 # include "./unittest/pair_unittest_.h"
00170 #endif 
00171 
00172 
00173 
00174 #ifndef _STLSOFT_NO_NAMESPACE
00175 } 
00176 #endif 
00177 
00178 
00179 
00180 #endif 
00181 
00182