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

Add a printing operator for mln::complex_psite.

	* mln/core/complex_psite.hh
	(operator<<(std::ostream&, const complex_psite<D, P>&)):
	New operator.
	* tests/core/complex_image.cc: ...here.


git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@2144 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent 0a619acf
2008-08-12 Roland Levillain <roland@lrde.epita.fr>
Add a printing operator for mln::complex_psite.
* mln/core/complex_psite.hh
(operator<<(std::ostream&, const complex_psite<D, P>&)):
New operator.
* tests/core/complex_image.cc: ...here.
2008-08-11 Roland Levillain <roland@lrde.epita.fr>
Add a complex-base image type.
......
......@@ -127,6 +127,16 @@ namespace mln
/// \}
/* FIXME: This hand-made delegation is painful. We should rely on
the general mechanism provided by Point_Site. But then again, we
need to refine/adjust the interface of Point_Site w.r.t. the
mandatory conversions to points. */
template <unsigned D, typename P>
inline
std::ostream&
operator<<(std::ostream& ostr, const complex_psite<D, P>& p);
# ifndef MLN_INCLUDE_ONLY
......@@ -254,6 +264,15 @@ namespace mln
return lhs.face() < rhs.face();
}
template <unsigned D, typename P>
inline
std::ostream&
operator<<(std::ostream& ostr, const complex_psite<D, P>& p)
{
return ostr << "(dim = " << p.n() << ", id = " << p.face_id() << ')';
}
# endif // ! MLN_INCLUDE_ONLY
......
......@@ -147,6 +147,7 @@ int main()
any_face_handle<D> af(e0_);
// An associated psite.
complex_psite<D, point2d> cs(af);
std::cout << cs << std::endl;
/*--------------------.
......
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