#pragma once #include #include #include namespace jvalidate::adapter::detail { template class JsonObjectIterator : public It { public: using value_type = std::pair; using reference = std::pair; using pointer = ::jvalidate::detail::DerefProxy; using difference_type = std::ptrdiff_t; using iterator_category = std::forward_iterator_tag; JsonObjectIterator() = default; JsonObjectIterator(It it) : It(it) {} reference operator*() const { return {Adapter::key(*this), Adapter(It::operator->())}; } pointer operator->() const { return {operator*()}; } JsonObjectIterator operator++(int) { auto tmp = *this; ++*this; return tmp; } JsonObjectIterator & operator++() { It::operator++(); return *this; } }; }