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,6 +15,7 @@
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/iterator/distance.hpp>
|
||||
#include <boost/range/begin.hpp>
|
||||
#include <boost/range/end.hpp>
|
||||
#include <boost/range/difference_type.hpp>
|
||||
@ -23,10 +24,10 @@ namespace boost
|
||||
{
|
||||
|
||||
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 )
|
||||
{
|
||||
return std::distance( boost::begin( r ), boost::end( r ) );
|
||||
return boost::distance( boost::begin( r ), boost::end( r ) );
|
||||
}
|
||||
|
||||
} // namespace 'boost'
|
||||
|
Reference in New Issue
Block a user