mirror of
https://github.com/boostorg/range.git
synced 2025-07-30 21:07:23 +02:00
Merge pull request #52 from morinmorin/use_boost_distance_from_iterator_lib
Make boost::distance traversal-category-aware (and constexpr in C++14)
This commit is contained in:
@ -15,18 +15,19 @@
|
|||||||
# pragma once
|
# pragma once
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <boost/iterator/distance.hpp>
|
||||||
#include <boost/range/begin.hpp>
|
#include <boost/range/begin.hpp>
|
||||||
#include <boost/range/end.hpp>
|
#include <boost/range/end.hpp>
|
||||||
#include <boost/range/difference_type.hpp>
|
#include <boost/range/difference_type.hpp>
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
|
|
||||||
template< class T >
|
template< class T >
|
||||||
inline BOOST_DEDUCED_TYPENAME range_difference<T>::type
|
inline BOOST_CXX14_CONSTEXPR BOOST_DEDUCED_TYPENAME range_difference<T>::type
|
||||||
distance( const T& r )
|
distance( const T& r )
|
||||||
{
|
{
|
||||||
return std::distance( boost::begin( r ), boost::end( r ) );
|
return boost::distance( boost::begin( r ), boost::end( r ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace 'boost'
|
} // namespace 'boost'
|
||||||
|
Reference in New Issue
Block a user