26 #ifndef MLN_SET_INTER_HH
27 # define MLN_SET_INTER_HH
36 # include <mln/core/site_set/p_set.hh>
37 # include <mln/convert/from_to.hh>
38 # include <mln/util/ord.hh>
52 template <
typename Sl,
typename Sr>
54 inter(
const Site_Set<Sl>& lhs,
const Site_Set<Sr>& rhs);
57 # ifndef MLN_INCLUDE_ONLY
59 template <
typename Sl,
typename Sr>
64 trace::entering(
"set::inter");
66 typedef mln_site(Sl) P;
67 mlc_converts_to(mln_psite(Sr), P)::check();
68 std::set< P, util::ord<P> > sl, sr, si;
69 convert::from_to(lhs, sl);
70 convert::from_to(rhs, sr);
71 std::set_intersection(sl.begin(), sl.end(),
73 std::inserter(si, si.begin()),
76 convert::from_to(si, s);
78 trace::exiting(
"set::inter");
82 # endif // ! MLN_INCLUDE_ONLY
89 #endif // ! MLN_SET_INTER_HH