From d85e5a45a8e0f3d76aeb760d3c735703be24e125 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorsten=20J=C3=B8rgen=20Ottosen?= Date: Tue, 29 Jun 2004 09:06:52 +0000 Subject: [PATCH] *** empty log message *** [SVN r23252] --- include/boost/range/iterator_range.hpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/include/boost/range/iterator_range.hpp b/include/boost/range/iterator_range.hpp index 4a5a1b7..e8852c0 100755 --- a/include/boost/range/iterator_range.hpp +++ b/include/boost/range/iterator_range.hpp @@ -14,8 +14,6 @@ #include #include #include -#include -#include #include #include #include @@ -164,7 +162,12 @@ namespace boost { */ size_type size() const { - return boost::size( make_pair( begin(), end() ) ); + return std::distance( m_Begin, m_End ); + } + + bool empty() const + { + return m_Begin == m_End; } //! Swap @@ -173,8 +176,8 @@ namespace boost { */ void swap( iterator_range& Other ) { - std::swap( m_Begin, Other.begin() ); - std::swap( m_End, Other.end() ); + std::swap( m_Begin, Other.m_Begin ); + std::swap( m_End, Other.m_End ); } //! Safe bool conversion @@ -192,7 +195,7 @@ namespace boost { typedef iterator (iterator_range::*unspecified_bool_type) () const; operator unspecified_bool_type() const { - return empty( *this )? 0: &iterator_range::end; + return empty() ? 0: &iterator_range::end; } /*