*** empty log message ***

[SVN r24638]
This commit is contained in:
Thorsten Jørgen Ottosen
2004-08-21 21:54:02 +00:00
parent 77dff97861
commit a929adc492
2 changed files with 13 additions and 0 deletions

View File

@ -14,6 +14,7 @@
#include <boost/range/config.hpp> #include <boost/range/config.hpp>
#include <boost/range/begin.hpp> #include <boost/range/begin.hpp>
#include <boost/range/end.hpp> #include <boost/range/end.hpp>
#include <boost/range/empty.hpp>
#include <boost/iterator/iterator_traits.hpp> #include <boost/iterator/iterator_traits.hpp>
#include <iterator> #include <iterator>
#include <algorithm> #include <algorithm>
@ -191,6 +192,16 @@ namespace boost {
// iterator range free-standing operators ---------------------------// // iterator range free-standing operators ---------------------------//
template< class Iterator >
inline bool empty( const iterator_range<Iterator>& r )
{
//
// this will preserve the well-defined empty() even
// though 'r' is singular.
//
return r.empty();
}
//! iterator_range output operator //! iterator_range output operator
/*! /*!
Output the range to an ostream. Elements are outputed Output the range to an ostream. Elements are outputed

View File

@ -121,6 +121,8 @@ void check_iterator_range()
BOOST_CHECK( singular_srange.empty() ); BOOST_CHECK( singular_srange.empty() );
BOOST_CHECK( singular_srange.size() == 0 ); BOOST_CHECK( singular_srange.size() == 0 );
BOOST_CHECK( empty( singular_irange ) );
BOOST_CHECK( empty( singular_srange ) );
} }