forked from boostorg/range
*** empty log message ***
[SVN r24638]
This commit is contained in:
@ -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
|
||||||
|
@ -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 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user