|
|
@@ -36,10 +36,10 @@ template <size_t N, size_t I> struct bounded {
|
|
|
|
|
|
template <typename It, typename Bnd = unbounded,
|
|
|
recursion_type = Bnd::template value<It>>
|
|
|
-struct tuple;
|
|
|
+struct tuple_expander;
|
|
|
|
|
|
template <typename It, typename Bnd>
|
|
|
-struct tuple<It, Bnd, recursion_type::END> {
|
|
|
+struct tuple_expander<It, Bnd, recursion_type::END> {
|
|
|
using iter = std::tuple<end_aware_iterator<It>>;
|
|
|
decltype(auto) get(It iter) const {
|
|
|
if constexpr (associative_value<std::iter_value_t<It>>) {
|
|
|
@@ -54,18 +54,20 @@ template <typename... Ts>
|
|
|
using tuple_cat_t = decltype(std::tuple_cat(VAL(Ts)...));
|
|
|
|
|
|
template <typename It, typename Bnd>
|
|
|
-struct tuple<It, Bnd, recursion_type::THRU> {
|
|
|
+struct tuple_expander<It, Bnd, recursion_type::THRU> {
|
|
|
using next = decltype(std::begin(*VAL(It)));
|
|
|
- using iter = tuple_cat_t<std::tuple<end_aware_iterator<It>>,
|
|
|
- typename tuple<next, typename Bnd::next>::iter>;
|
|
|
+ using iter =
|
|
|
+ tuple_cat_t<std::tuple<end_aware_iterator<It>>,
|
|
|
+ typename tuple_expander<next, typename Bnd::next>::iter>;
|
|
|
auto get(It) const { return std::make_tuple(); }
|
|
|
};
|
|
|
|
|
|
template <typename It, typename Bnd>
|
|
|
-struct tuple<It, Bnd, recursion_type::ASSOC> {
|
|
|
+struct tuple_expander<It, Bnd, recursion_type::ASSOC> {
|
|
|
using next = decltype(std::begin(VAL(It)->second));
|
|
|
- using iter = tuple_cat_t<std::tuple<end_aware_iterator<It>>,
|
|
|
- typename tuple<next, typename Bnd::next>::iter>;
|
|
|
+ using iter =
|
|
|
+ tuple_cat_t<std::tuple<end_aware_iterator<It>>,
|
|
|
+ typename tuple_expander<next, typename Bnd::next>::iter>;
|
|
|
auto get(It iter) const { return std::tie(iter->first); };
|
|
|
};
|
|
|
|
|
|
@@ -87,9 +89,8 @@ template <typename It, typename Bnd>
|
|
|
class rimpl : public facade<rimpl<It, Bnd>> {
|
|
|
public:
|
|
|
using sentinel_type = sentinel_t;
|
|
|
- using iters_t = typename tuple<It, Bnd>::iter;
|
|
|
- static constexpr size_t n_iters =
|
|
|
- std::tuple_size_v<typename tuple<It, Bnd>::iter>;
|
|
|
+ using iters_t = typename tuple_expander<It, Bnd>::iter;
|
|
|
+ static constexpr size_t n_iters = std::tuple_size_v<iters_t>;
|
|
|
static constexpr size_t size = std::min(n_iters, Bnd::size);
|
|
|
|
|
|
private:
|
|
|
@@ -146,9 +147,10 @@ private:
|
|
|
// effectively terminal iterator is treated as such even if there is still
|
|
|
// iteration to be had.
|
|
|
if constexpr (I == size - 1) {
|
|
|
- return tuple<decltype(it), unbounded, recursion_type::END>{}.get(it);
|
|
|
+ return tuple_expander<decltype(it), unbounded, recursion_type::END>{}.get(
|
|
|
+ it);
|
|
|
} else {
|
|
|
- return tuple<decltype(it)>{}.get(it);
|
|
|
+ return tuple_expander<decltype(it)>{}.get(it);
|
|
|
}
|
|
|
}
|
|
|
|