From 29586c6e819ba29a5a7cc09a1aa0a47077d883ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9=20=D0=98=D0=B7?= =?UTF-8?q?=D0=B2=D0=BE=D0=BB=D0=BE=D0=B2?= Date: Sat, 13 Jun 2020 22:38:08 +0300 Subject: [PATCH] =?UTF-8?q?refs=20#113=20=D0=9C=D0=B5=D1=82=D0=B0=D1=84?= =?UTF-8?q?=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D1=8F=20range=5Fiterator?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/burst/iterator/detail/join_iterator.hpp | 3 ++- include/burst/range/detail/skip_to_lower_bound.hpp | 6 ++++-- include/burst/range/detail/skip_to_upper_bound.hpp | 6 ++++-- include/burst/range/take_n.hpp | 4 ++-- include/burst/type_traits/range_iterator.hpp | 12 ++++++++++++ 5 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 include/burst/type_traits/range_iterator.hpp diff --git a/include/burst/iterator/detail/join_iterator.hpp b/include/burst/iterator/detail/join_iterator.hpp index 02be4535..a7835e89 100644 --- a/include/burst/iterator/detail/join_iterator.hpp +++ b/include/burst/iterator/detail/join_iterator.hpp @@ -2,6 +2,7 @@ #define BURST_ITERATOR_DETAIL_JOIN_ITERATOR_HPP #include +#include #include #include @@ -184,7 +185,7 @@ namespace burst private: using outer_range_iterator = RandomAccessIterator; using inner_range_type = typename std::iterator_traits::value_type; - using inner_range_iterator = typename boost::range_iterator::type; + using inner_range_iterator = range_iterator_t; using base_type = boost::iterator_facade diff --git a/include/burst/range/detail/skip_to_lower_bound.hpp b/include/burst/range/detail/skip_to_lower_bound.hpp index 85806da7..ed8e56d8 100644 --- a/include/burst/range/detail/skip_to_lower_bound.hpp +++ b/include/burst/range/detail/skip_to_lower_bound.hpp @@ -1,6 +1,8 @@ #ifndef BURST_RANGE_DETAIL_SKIP_TO_LOWER_BOUND_HPP #define BURST_RANGE_DETAIL_SKIP_TO_LOWER_BOUND_HPP +#include + #include #include @@ -22,7 +24,7 @@ namespace burst std::is_same < std::random_access_iterator_tag, - typename std::iterator_traits::type>::iterator_category + typename std::iterator_traits>::iterator_category > ::value, void @@ -51,7 +53,7 @@ namespace burst not std::is_same < std::random_access_iterator_tag, - typename std::iterator_traits::type>::iterator_category + typename std::iterator_traits>::iterator_category > ::value, void diff --git a/include/burst/range/detail/skip_to_upper_bound.hpp b/include/burst/range/detail/skip_to_upper_bound.hpp index a2984729..9a7c2175 100644 --- a/include/burst/range/detail/skip_to_upper_bound.hpp +++ b/include/burst/range/detail/skip_to_upper_bound.hpp @@ -1,6 +1,8 @@ #ifndef BURST_RANGE_DETAIL_SKIP_TO_UPPER_BOUND_HPP #define BURST_RANGE_DETAIL_SKIP_TO_UPPER_BOUND_HPP +#include + #include #include @@ -22,7 +24,7 @@ namespace burst std::is_same < std::random_access_iterator_tag, - typename std::iterator_traits::type>::iterator_category + typename std::iterator_traits>::iterator_category > ::value, void @@ -51,7 +53,7 @@ namespace burst not std::is_same < std::random_access_iterator_tag, - typename std::iterator_traits::type>::iterator_category + typename std::iterator_traits>::iterator_category > ::value, void diff --git a/include/burst/range/take_n.hpp b/include/burst/range/take_n.hpp index 4beabf84..5f3262b9 100644 --- a/include/burst/range/take_n.hpp +++ b/include/burst/range/take_n.hpp @@ -2,10 +2,10 @@ #define BURST_RANGE_TAKE_N_HPP #include +#include #include #include -#include #include #include @@ -24,7 +24,7 @@ namespace burst template auto operator () (Range && range, Integer n) const { - using range_iterator = typename boost::range_iterator::type; + using range_iterator = range_iterator_t; using category = typename std::common_type < diff --git a/include/burst/type_traits/range_iterator.hpp b/include/burst/type_traits/range_iterator.hpp new file mode 100644 index 00000000..a708adcf --- /dev/null +++ b/include/burst/type_traits/range_iterator.hpp @@ -0,0 +1,12 @@ +#ifndef BURST_TYPE_TRAITS_RANGE_ITERATOR_HPP +#define BURST_TYPE_TRAITS_RANGE_ITERATOR_HPP + +#include + +namespace burst +{ + template + using range_iterator_t = typename boost::range_iterator::type; +} // namespace burst + +#endif // BURST_TYPE_TRAITS_RANGE_ITERATOR_HPP