6 #include <nlohmann/detail/value_t.hpp>
13 template<
typename IteratorType>
class iteration_proxy
17 class iteration_proxy_internal
23 std::size_t array_index = 0;
26 explicit iteration_proxy_internal(IteratorType it) noexcept : anchor(it) {}
35 iteration_proxy_internal& operator++()
44 bool operator!=(
const iteration_proxy_internal& o)
const noexcept
46 return anchor != o.anchor;
52 assert(anchor.m_object !=
nullptr);
54 switch (anchor.m_object->type())
58 return std::to_string(array_index);
71 typename IteratorType::reference value()
const
73 return anchor.value();
78 typename IteratorType::reference container;
86 iteration_proxy_internal
begin() noexcept
88 return iteration_proxy_internal(container.begin());
92 iteration_proxy_internal
end() noexcept
94 return iteration_proxy_internal(container.end());