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());
Point operator*(double s, const Point &a)
Multiply point by scalar.
Definition: shapes.h:245
array (ordered collection of values)
iteration_proxy(typename IteratorType::reference cont) noexcept
construct iteration proxy from a container
Definition: iteration_proxy.hpp:82
namespace for Niels Lohmann
Definition: adl_serializer.hpp:8
object (unordered set of name/value pairs)
iteration_proxy_internal begin() noexcept
return iterator begin (needed for range-based for)
Definition: iteration_proxy.hpp:86
iteration_proxy_internal end() noexcept
return iterator end (needed for range-based for)
Definition: iteration_proxy.hpp:92