27 #ifndef MLN_UTIL_SITE_PAIR_HH
28 # define MLN_UTIL_SITE_PAIR_HH
30 # include <mln/core/concept/proxy.hh>
31 # include <mln/util/ord_pair.hh>
64 const P& first() const;
66 const P& second() const;
92 operator<<(std::ostream& ostr, const
site_pair<P>&
p);
105 template <
typename P,
typename E>
108 const P&
first()
const;
113 const E& exact_()
const;
122 # ifndef MLN_INCLUDE_ONLY
131 template <
typename P>
136 template <
typename P>
138 : pair_(first, second)
142 template <
typename P>
147 return pair_.first();
150 template <
typename P>
155 return pair_.second();
158 template <
typename P>
160 const util::ord_pair<P>&
170 template <
typename P>
175 return lhs.pair() == rhs.pair();
178 template <
typename P>
181 operator< (const site_pair<P>& lhs,
const site_pair<P>&
rhs)
183 return lhs.pair() < rhs.pair();
186 template <
typename P>
189 operator<=(const site_pair<P>& lhs,
const site_pair<P>&
rhs)
191 return lhs.pair() <= rhs.pair();
194 template <
typename P>
197 operator<<(std::ostream& ostr, const site_pair<P>&
p)
199 ostr <<
"(" <<
p.first() <<
", " <<
p.second() <<
")";
208 template <
typename P,
typename E>
213 return internal::force_exact<const E>(*this);
216 template <
typename P,
typename E>
221 return exact_().get_subject().first();
224 template <
typename P,
typename E>
229 return exact_().get_subject().second();
234 # endif // ! MLN_INCLUDE_ONLY
239 #endif // ! MLN_UTIL_SITE_PAIR_HH