mirror of
https://github.com/boostorg/iterator.git
synced 2026-07-04 23:50:57 +02:00
Reformat and simplify code.
This commit is contained in:
@@ -7,12 +7,12 @@
|
||||
#ifndef BOOST_ITERATOR_ADVANCE_HPP
|
||||
#define BOOST_ITERATOR_ADVANCE_HPP
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/iterator/is_iterator.hpp>
|
||||
#include <boost/iterator/iterator_categories.hpp>
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
namespace boost {
|
||||
namespace iterators {
|
||||
namespace detail {
|
||||
@@ -59,8 +59,7 @@ inline BOOST_CXX14_CONSTEXPR void advance_impl(RandomAccessIterator& it, Distanc
|
||||
namespace advance_adl_barrier {
|
||||
|
||||
template< typename InputIterator, typename Distance >
|
||||
inline BOOST_CXX14_CONSTEXPR
|
||||
typename std::enable_if< boost::is_iterator< InputIterator >::value, void >::type
|
||||
inline BOOST_CXX14_CONSTEXPR typename std::enable_if< is_iterator< InputIterator >::value >::type
|
||||
advance(InputIterator& it, Distance n)
|
||||
{
|
||||
detail::advance_impl(it, n, typename iterator_traversal< InputIterator >::type());
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
#ifndef BOOST_ITERATOR_DISTANCE_HPP
|
||||
#define BOOST_ITERATOR_DISTANCE_HPP
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/iterator/is_iterator.hpp>
|
||||
#include <boost/iterator/iterator_categories.hpp>
|
||||
#include <boost/iterator/iterator_traits.hpp>
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
namespace boost {
|
||||
namespace iterators {
|
||||
namespace detail {
|
||||
@@ -44,12 +44,10 @@ distance_impl(RandomAccessIterator first, RandomAccessIterator last, random_acce
|
||||
namespace distance_adl_barrier {
|
||||
|
||||
template< typename SinglePassIterator >
|
||||
inline BOOST_CXX14_CONSTEXPR
|
||||
typename std::enable_if<
|
||||
boost::is_iterator< SinglePassIterator >::value,
|
||||
inline BOOST_CXX14_CONSTEXPR typename std::enable_if<
|
||||
is_iterator< SinglePassIterator >::value,
|
||||
iterator_difference< SinglePassIterator >
|
||||
>::type::type
|
||||
distance(SinglePassIterator first, SinglePassIterator last)
|
||||
>::type::type distance(SinglePassIterator first, SinglePassIterator last)
|
||||
{
|
||||
return detail::distance_impl(first, last, typename iterator_traversal< SinglePassIterator >::type());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user