|
|
@@ -19,21 +19,21 @@
|
|
|
#include <iterator/detail/macro.h>
|
|
|
|
|
|
namespace iterator::recursive {
|
|
|
+struct unbounded {
|
|
|
+ template <typename It>
|
|
|
+ static constexpr recursion_type const value = iter_typeclass<It>;
|
|
|
+ using next = unbounded;
|
|
|
+ static constexpr size_t size = std::numeric_limits<size_t>::max();
|
|
|
+};
|
|
|
+
|
|
|
template <size_t N, size_t I> struct bounded {
|
|
|
template <typename It>
|
|
|
static constexpr recursion_type const value =
|
|
|
- I == N ? recursion_type::END : typeclass_t<It>::value;
|
|
|
+ I == N ? recursion_type::END : iter_typeclass<It>;
|
|
|
using next = std::conditional_t<I == N, void, bounded<N, I + 1>>;
|
|
|
static constexpr size_t size = N;
|
|
|
};
|
|
|
|
|
|
-struct unbounded {
|
|
|
- template <typename It>
|
|
|
- static constexpr recursion_type const value = typeclass_t<It>::value;
|
|
|
- using next = unbounded;
|
|
|
- static constexpr size_t size = std::numeric_limits<size_t>::max();
|
|
|
-};
|
|
|
-
|
|
|
template <typename It, typename Bnd = unbounded,
|
|
|
recursion_type = Bnd::template value<It>>
|
|
|
struct tuple;
|
|
|
@@ -42,7 +42,7 @@ template <typename It, typename Bnd>
|
|
|
struct tuple<It, Bnd, recursion_type::END> {
|
|
|
using iter = std::tuple<end_aware_iterator<It>>;
|
|
|
decltype(auto) get(It iter) const {
|
|
|
- if constexpr (is_associative<It>{}) {
|
|
|
+ if constexpr (associative_value<std::iter_value_t<It>>) {
|
|
|
return std::tie(iter->first, iter->second);
|
|
|
} else {
|
|
|
return std::tie(*iter);
|
|
|
@@ -199,12 +199,12 @@ auto get(::iterator::recursive_iterator_n<It, N> const & iter) {
|
|
|
}
|
|
|
|
|
|
template <typename C> auto make_recursive_iterator(C && collect) {
|
|
|
- return iterator::recursive_iterator<iterator::detail::iter<C>>(collect);
|
|
|
+ return iterator::recursive_iterator<iterator::iterator_t<C>>(collect);
|
|
|
}
|
|
|
|
|
|
template <std::size_t Max, typename C>
|
|
|
auto make_recursive_iterator(C && collect) {
|
|
|
- return iterator::recursive_iterator_n<iterator::detail::iter<C>, Max>(
|
|
|
+ return iterator::recursive_iterator_n<iterator::iterator_t<C>, Max>(
|
|
|
collect);
|
|
|
}
|
|
|
|