#pragma once #include "../end_aware_iterator.hpp" #include "traits.hpp" namespace iterator::recursive { /** * @class recursive_iterator_base * @brief A thin wrapper around end_aware_iterator for the purposes of * template metaprogramming. */ template class base : public end_aware_iterator { public: using super = end_aware_iterator; protected: using recursive_category = std::conditional_t{}, continue_layer_tag_t, terminal_layer_tag_t>; public: using super::super; base(super const & iter) : super(iter) {} base(super && iter) : super(std::move(iter)) {} protected: decltype(auto) get() const { if constexpr (is_associative{}) { return std::tie((**this).first, (**this).second); } else { return **this; } } }; }