26 #ifndef MLN_UTIL_SITE_PAIR_HH
27 # define MLN_UTIL_SITE_PAIR_HH
29 # include <mln/core/concept/proxy.hh>
30 # include <mln/util/ord_pair.hh>
57 typedef mln_coord(P) coord;
63 const P&
first()
const;
84 bool operator< (const site_pair<P>& lhs,
const site_pair<P>& rhs);
87 bool operator< (const site_pair<P>& lhs,
const site_pair<P>& rhs);
91 operator<<(std::ostream& ostr, const site_pair<P>& p);
102 template <
typename P,
typename E>
103 struct subject_impl< const util::site_pair<P>, E >
105 const P& first()
const;
106 const P& second()
const;
110 const E& exact_()
const;
119 # ifndef MLN_INCLUDE_ONLY
128 template <
typename P>
129 site_pair<P>::site_pair()
133 template <
typename P>
134 site_pair<P>::site_pair(
const P& first,
const P& second)
135 : pair_(first, second)
139 template <
typename P>
144 return pair_.first();
147 template <
typename P>
152 return pair_.second();
155 template <
typename P>
167 template <
typename P>
175 template <
typename P>
178 operator< (const site_pair<P>& lhs,
const site_pair<P>& rhs)
183 template <
typename P>
186 operator<=(const site_pair<P>& lhs,
const site_pair<P>& rhs)
191 template <
typename P>
194 operator<<(std::ostream& ostr, const site_pair<P>& p)
196 ostr <<
"(" << p.first() <<
", " << p.second() <<
")";
205 template <
typename P,
typename E>
208 subject_impl< const util::site_pair<P>, E >::exact_()
const
210 return internal::force_exact<const E>(*this);
213 template <
typename P,
typename E>
216 subject_impl< const util::site_pair<P>, E >::first()
const
218 return exact_().get_subject().first();
221 template <
typename P,
typename E>
224 subject_impl< const util::site_pair<P>, E >::second()
const
226 return exact_().get_subject().second();
231 # endif // ! MLN_INCLUDE_ONLY
236 #endif // ! MLN_UTIL_SITE_PAIR_HH