26 #ifndef MLN_UTIL_COUPLE_HH
27 # define MLN_UTIL_COUPLE_HH
35 # include <mln/core/concept/object.hh>
36 # include <mln/util/ord.hh>
47 template <
typename T,
typename U>
52 couple(
const T& val1,
const U& val2);
56 const T&
first()
const;
81 template <
typename T,
typename U>
84 template <
typename T,
typename U>
85 bool operator< (const couple<T,U>& lhs,
const couple<T,U>& rhs);
87 template <
typename T,
typename U>
88 bool operator<=(const couple<T,U>& lhs,
const couple<T,U>& rhs);
91 template <
typename T,
typename U>
92 std::ostream& operator<<(std::ostream& ostr, const couple<T,U>& op);
100 template <
typename T,
typename U>
105 # ifndef MLN_INCLUDE_ONLY
114 template <
typename T,
typename U>
116 couple<T,U>::couple()
120 template <
typename T,
typename U>
122 couple<T,U>::couple(
const T& val1,
const U& val2)
124 change_both(val1, val2);
131 template <
typename T,
typename U>
139 template <
typename T,
typename U>
147 template <
typename T,
typename U>
155 template <
typename T,
typename U>
163 template <
typename T,
typename U>
171 template <
typename T,
typename U>
179 template <
typename T,
typename U>
192 template <
typename T,
typename U>
199 template <
typename T,
typename U>
201 bool operator< (const couple<T,U>& lhs,
const couple<T,U>& rhs)
209 template <
typename T,
typename U>
211 bool operator<=(const couple<T,U>& lhs,
const couple<T,U>& rhs)
223 template <
typename T,
typename U>
225 std::ostream& operator<<(std::ostream& ostr, const couple<T,U>& op)
227 return ostr <<
'(' << op.first() <<
',' << op.second() <<
')';
236 template <
typename T,
typename U>
239 couple(
const T& val1,
const U& val2)
241 util::couple<T,U> tmp(val1, val2);
247 # endif // ! MLN_INCLUDE_ONLY
252 #endif // ! MLN_UTIL_COUPLE_HH