Skip to content

Commit

Permalink
Make boost::distance traversal-category-aware (and constexpr in C++14)
Browse files Browse the repository at this point in the history
  • Loading branch information
morinmorin committed Jun 30, 2017
1 parent 452b1bb commit 69409ed
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions include/boost/range/distance.hpp
Expand Up @@ -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'
Expand Down

0 comments on commit 69409ed

Please sign in to comment.