29template<
typename string_type>
44 using string_type =
typename std::remove_cv< typename std::remove_reference<decltype( std::declval<IteratorType>().
key() ) >
::type >
::type;
48 IteratorType anchor{};
50 std::size_t array_index = 0;
52 mutable std::size_t array_index_last = 0;
61 noexcept(
std::is_nothrow_move_constructible<IteratorType>::
value
63 : anchor(
std::move(it))
64 , array_index(array_index_)
71 noexcept(
std::is_nothrow_move_constructible<IteratorType>::
value
74 noexcept(
std::is_nothrow_move_assignable<IteratorType>::
value
104 return anchor == o.anchor;
110 return anchor != o.anchor;
118 switch (anchor.m_object->type())
123 if (array_index != array_index_last)
126 array_index_last = array_index;
128 return array_index_str;
150 typename IteratorType::reference
value()
const
152 return anchor.value();
161 typename IteratorType::pointer container =
nullptr;
168 : container(&cont) {}
192template<std::
size_t N,
typename IteratorType, enable_if_t<N == 0,
int> = 0>
193auto get(
const wpi::detail::iteration_proxy_value<IteratorType>& i) ->
decltype(i.key())
200template<std::
size_t N,
typename IteratorType, enable_if_t<N == 1,
int> = 0>
201auto get(
const wpi::detail::iteration_proxy_value<IteratorType>& i) ->
decltype(i.value())
216#if defined(__clang__)
218 #pragma clang diagnostic push
219 #pragma clang diagnostic ignored "-Wmismatched-tags"
221template<
typename IteratorType>
222class tuple_size<::wpi::detail::iteration_proxy_value<IteratorType>>
223 :
public std::integral_constant<std::size_t, 2> {};
225template<std::
size_t N,
typename IteratorType>
226class tuple_element<N, ::wpi::detail::iteration_proxy_value<IteratorType >>
230 get<N>(std::declval <
231 ::wpi::detail::iteration_proxy_value<IteratorType >> ()));
233#if defined(__clang__)
234 #pragma clang diagnostic pop
240 template <
typename IteratorType>
241 inline constexpr bool ::std::ranges::enable_borrowed_range<::wpi::detail::iteration_proxy<IteratorType>> =
true;
#define WPI_JSON_NAMESPACE_END
Definition: abi_macros.h:59
#define WPI_JSON_NAMESPACE_BEGIN
Definition: abi_macros.h:53
Definition: iteration_proxy.h:37
iteration_proxy_value operator++(int) &
Definition: iteration_proxy.h:93
iteration_proxy_value(iteration_proxy_value const &)=default
bool operator==(const iteration_proxy_value &o) const
equality operator (needed for InputIterator)
Definition: iteration_proxy.h:102
bool operator!=(const iteration_proxy_value &o) const
inequality operator (needed for range-based for)
Definition: iteration_proxy.h:108
std::ptrdiff_t difference_type
Definition: iteration_proxy.h:39
iteration_proxy_value(IteratorType it, std::size_t array_index_=0) noexcept(std::is_nothrow_move_constructible< IteratorType >::value &&std::is_nothrow_default_constructible< string_type >::value)
Definition: iteration_proxy.h:60
iteration_proxy_value & operator++()
increment operator (needed for range-based for)
Definition: iteration_proxy.h:85
iteration_proxy_value()=default
iteration_proxy_value(iteration_proxy_value &&) noexcept(std::is_nothrow_move_constructible< IteratorType >::value &&std::is_nothrow_move_constructible< string_type >::value)=default
IteratorType::reference value() const
return value of the iterator
Definition: iteration_proxy.h:150
const string_type & key() const
return key of the iterator
Definition: iteration_proxy.h:114
iteration_proxy_value & operator=(iteration_proxy_value const &)=default
std::input_iterator_tag iterator_category
Definition: iteration_proxy.h:43
typename std::remove_cv< typename std::remove_reference< decltype(std::declval< IteratorType >().key()) >::type >::type string_type
Definition: iteration_proxy.h:44
proxy class for the items() function
Definition: iteration_proxy.h:158
iteration_proxy_value< IteratorType > end() const noexcept
return iterator end (needed for range-based for)
Definition: iteration_proxy.h:183
iteration_proxy(iteration_proxy const &)=default
iteration_proxy()=default
iteration_proxy(iteration_proxy &&) noexcept=default
iteration_proxy_value< IteratorType > begin() const noexcept
return iterator begin (needed for range-based for)
Definition: iteration_proxy.h:177
iteration_proxy(typename IteratorType::reference cont) noexcept
construct iteration proxy from a container
Definition: iteration_proxy.h:167
iteration_proxy & operator=(iteration_proxy const &)=default
decltype(get< N >(std::declval< ::wpi::detail::iteration_proxy_value< IteratorType > >())) type
Definition: iteration_proxy.h:231
#define JSON_ASSERT(x)
Definition: macro_scope.h:192
detail namespace with internal helper functions
Definition: xchar.h:20
auto get(const wpi::detail::iteration_proxy_value< IteratorType > &i) -> decltype(i.key())
Definition: iteration_proxy.h:193
@ number_integer
number value (signed integer)
@ discarded
discarded by the parser callback function
@ binary
binary array (ordered collection of bytes)
@ object
object (unordered set of name/value pairs)
@ number_float
number value (floating-point)
@ number_unsigned
number value (unsigned integer)
@ array
array (ordered collection of values)
type
Definition: core.h:556
void int_to_string(string_type &target, std::size_t value)
Definition: iteration_proxy.h:30
std::string to_string(const T &t)
Definition: base.h:92