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:
neilgroves
2017-06-30 12:40:18 +01:00
committed by GitHub

View File

@ -15,18 +15,19 @@
# pragma once
#endif
#include <boost/iterator/distance.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/difference_type.hpp>
namespace boost
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'