2456: Overhaul conversions of complex_relative_iterator_base<F, E>.

* mln/topo/internal/complex_relative_iterator_base.hh (complex_relative_iterator_base<F, E>::to_face): Remove. (complex_relative_iterator_base<F, E>::operator face): Turn into... (complex_relative_iterator_base<F, E>::operator const face&): ..this. Return a const reference to the held face instead of a copy, so that its address can be safely taken. Remove the precondition, as invalid iterators are allowed to give access to the face they hold. --- milena/ChangeLog | 16 ++++++++++++++++ .../internal/complex_relative_iterator_base.hh | 15 ++------------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index cf00b66..5107bb1 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,5 +1,21 @@ 2008-10-01 Roland Levillain <roland@lrde.epita.fr> + Overhaul conversions of complex_relative_iterator_base<F, E>. + + * mln/topo/internal/complex_relative_iterator_base.hh + (complex_relative_iterator_base<F, E>::to_face): + Remove. + (complex_relative_iterator_base<F, E>::operator face): + Turn into... + (complex_relative_iterator_base<F, E>::operator const face&): + ..this. + Return a const reference to the held face instead of a copy, so + that its address can be safely taken. + Remove the precondition, as invalid iterators are allowed to give + access to the face they hold. + +2008-10-01 Roland Levillain <roland@lrde.epita.fr> + Delegate pretty-printing of complex_psite<D> to topo::face<D>. * mln/core/site_set/complex_psite.hh diff --git a/milena/mln/topo/internal/complex_relative_iterator_base.hh b/milena/mln/topo/internal/complex_relative_iterator_base.hh index 599727a..43a38ae 100644 --- a/milena/mln/topo/internal/complex_relative_iterator_base.hh +++ b/milena/mln/topo/internal/complex_relative_iterator_base.hh @@ -110,10 +110,8 @@ namespace mln /// Conversion and accessors. /// \{ - /// Reference to the corresponding face handle. - const face& to_face () const; /// Convert the iterator into an face handle. - operator face() const; + operator const face&() const; /// \} protected: @@ -297,20 +295,11 @@ namespace mln template <typename F, typename E> inline - const F& - complex_relative_iterator_base<F, E>::to_face() const + complex_relative_iterator_base<F, E>::operator const F&() const { return f_; } - template <typename F, typename E> - inline - complex_relative_iterator_base<F, E>::operator F() const - { - mln_precondition(exact(this)->is_valid()); - return f_; - } - template <typename F, typename E> inline -- 1.6.0.1
participants (1)
-
Roland Levillain