Reformat and simplify code.

This commit is contained in:
Andrey Semashev
2026-06-21 18:15:19 +03:00
parent 286c9885d6
commit 0316628863
2 changed files with 8 additions and 11 deletions
+3 -4
View File
@@ -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());
+5 -7
View File
@@ -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());
}