Commit a517df64 authored by Roland Levillain's avatar Roland Levillain
Browse files

Add a dummy operator< to mln::util::multi_site<P>.

	* mln/util/multi_site.hh
	(operator< (const multi_site<P>& lhs, const multi_site<P>& rhs)):
	New.

git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4578 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent 785eba81
2009-09-29 Roland Levillain <roland@lrde.epita.fr>
Add a dummy operator< to mln::util::multi_site<P>.
* mln/util/multi_site.hh
(operator< (const multi_site<P>& lhs, const multi_site<P>& rhs)):
New.
2009-09-29 Roland Levillain <roland@lrde.epita.fr>
 
Have mln::topo::is_n_face<B> expose a more tolerant interface.
......@@ -31,10 +31,14 @@
# include <cstddef>
# include <algorithm>
# include <vector>
# include <mln/core/concept/object.hh>
# include <mln/util/ord.hh>
namespace mln
{
......@@ -80,6 +84,12 @@ namespace mln
bool
operator==(const multi_site<P>& lhs, const multi_site<P>& rhs);
/* FIXME: Required (indirectly) by a postcondition in
mln::morpho::dilation. */
template <typename P>
bool
operator< (const multi_site<P>& lhs, const multi_site<P>& rhs);
# ifndef MLN_INCLUDE_ONLY
......@@ -143,6 +153,17 @@ namespace mln
return lhs.sites == rhs.sites;
}
template <typename P>
bool
operator< (const multi_site<P>& lhs, const multi_site<P>& rhs)
{
// FIXME: This comparison is meaningless, since LHS and RHS are
// not sorted!
return std::lexicographical_compare(lhs.sites.begin(), lhs.sites.end(),
rhs.sites.begin(), rhs.sites.end(),
util::ord<P>());
}
# endif // ! MLN_INCLUDE_ONLY
} // end of mln::util
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment