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>
87 template <
typename T,
typename U>
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>
120 template <
typename T,
typename U>
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>
194 bool operator==(
const couple<T,U>& lhs,
const couple<T,U>&
rhs)
196 return lhs.first() == rhs.first() && lhs.second() == rhs.second();
199 template <
typename T,
typename U>
201 bool operator< (const couple<T,U>& lhs,
const couple<T,U>&
rhs)
205 (lhs.first() == rhs.first() &&
209 template <
typename T,
typename U>
211 bool operator<=(const couple<T,U>& lhs,
const couple<T,U>&
rhs)
215 (lhs.first() == rhs.first() &&
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