nlohmann::detail::iter_impl
json.hpp
typename BasicJsonType BasicJsonType
iter_impl< typename std::conditional< std::is_const< BasicJsonType >::value, typename std::remove_const< BasicJsonType >::type, const BasicJsonType >::type > using nlohmann::detail::iter_impl< BasicJsonType >::other_iter_impl = iter_impl<typename std::conditional<std::is_const<BasicJsonType>::value, typename std::remove_const<BasicJsonType>::type, const BasicJsonType>::type> other_iter_impl

the iterator with BasicJsonType of different const-ness

typename BasicJsonType::object_t using nlohmann::detail::iter_impl< BasicJsonType >::object_t = typename BasicJsonType::object_t object_t
typename BasicJsonType::array_t using nlohmann::detail::iter_impl< BasicJsonType >::array_t = typename BasicJsonType::array_t array_t
std::bidirectional_iterator_tag using nlohmann::detail::iter_impl< BasicJsonType >::iterator_category = std::bidirectional_iterator_tag iterator_category

The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17. The C++ Standard has never required user-defined iterators to derive from std::iterator. A user-defined iterator should provide publicly accessible typedefs named iterator_category, value_type, difference_type, pointer, and reference. Note that value_type is required to be non-const, even for constant iterators.

typename BasicJsonType::value_type using nlohmann::detail::iter_impl< BasicJsonType >::value_type = typename BasicJsonType::value_type value_type

the type of the values when the iterator is dereferenced

typename BasicJsonType::difference_type using nlohmann::detail::iter_impl< BasicJsonType >::difference_type = typename BasicJsonType::difference_type difference_type

a type to represent differences between iterators

typename std::conditional< std::is_const< BasicJsonType >::value, typename BasicJsonType::const_pointer, typename BasicJsonType::pointer >::type using nlohmann::detail::iter_impl< BasicJsonType >::pointer = typename std::conditional<std::is_const<BasicJsonType>::value, typename BasicJsonType::const_pointer, typename BasicJsonType::pointer>::type pointer

defines a pointer to the type iterated over (value_type)

typename std::conditional< std::is_const< BasicJsonType >::value, typename BasicJsonType::const_reference, typename BasicJsonType::reference >::type using nlohmann::detail::iter_impl< BasicJsonType >::reference = typename std::conditional<std::is_const<BasicJsonType>::value, typename BasicJsonType::const_reference, typename BasicJsonType::reference>::type reference

defines a reference to the type iterated over (value_type)

friend friend nlohmann::detail::iter_impl< BasicJsonType >::other_iter_impl other_iter_impl

allow basic_json to access private members

friend friend nlohmann::detail::iter_impl< BasicJsonType >::BasicJsonType BasicJsonType
friend friend nlohmann::detail::iter_impl< BasicJsonType >::iteration_proxy< iter_impl > iteration_proxy< iter_impl >
friend friend nlohmann::detail::iter_impl< BasicJsonType >::iteration_proxy_value< iter_impl > iteration_proxy_value< iter_impl >
JSON_PRIVATE_UNLESS_TESTED JSON_PRIVATE_UNLESS_TESTED nlohmann::detail::iter_impl< BasicJsonType >::__pad0__ __pad0__ void set_begin() noexcept { JSON_ASSERT(m_object != nullptr)
JSON_PRIVATE_UNLESS_TESTED JSON_PRIVATE_UNLESS_TESTED nlohmann::detail::iter_impl< BasicJsonType >::__pad1__ __pad1__ pointer m_object = nullptr
internal_iterator< typename std::remove_const< BasicJsonType >::type > internal_iterator<typename std::remove_const<BasicJsonType>::type> nlohmann::detail::iter_impl< BasicJsonType >::m_it m_it {}

the actual iterator of the associated instance

nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >::insert
nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >::insert_iterator
nlohmann::detail::iter_impl< BasicJsonType >::operator-
nlohmann::detail::iter_impl< BasicJsonType >::operator<
nlohmann::detail::iter_impl< BasicJsonType >::operator=
nlohmann::detail::iter_impl< BasicJsonType >::iter_impl
()=default
iter_impl
nlohmann::detail::iter_impl< BasicJsonType >::~iter_impl
()=default
~iter_impl
nlohmann::detail::iter_impl< BasicJsonType >::iter_impl
(iter_impl &&) noexcept=default
iter_impl
iter_impl &&
iter_impl & iter_impl& nlohmann::detail::iter_impl< BasicJsonType >::operator= (iter_impl &&) noexcept=default operator= iter_impl &&
nlohmann::detail::iter_impl< BasicJsonType >::iter_impl
(pointer object) noexcept
iter_impl
pointer object

constructor for a given JSON instance

object

pointer to a JSON object for this iterator

object != nullptr

The iterator is initialized; i.e. `m_object != nullptr`.

nlohmann::detail::array
JSON_ASSERT
nlohmann::detail::object
nlohmann::detail::iter_impl< BasicJsonType >::iter_impl
(const iter_impl< const BasicJsonType > &other) noexcept
iter_impl
const iter_impl< const BasicJsonType > & other

const copy constructor

The conventional copy constructor and copy assignment are implicitly defined. Combined with the following converting constructor and assignment, they support: (1) copy from iterator to iterator, (2) copy from const iterator to const iterator, and (3) conversion from iterator to const iterator. However conversion from const iterator to iterator is not defined.

other

const iterator to copy from

This copy constructor had to be defined explicitly to circumvent a bug occurring on msvc v19.0 compiler (VS 2015) debug build. For more information refer to: https://github.com/nlohmann/json/issues/1608

iter_impl & iter_impl& nlohmann::detail::iter_impl< BasicJsonType >::operator= (const iter_impl< const BasicJsonType > &other) noexcept operator= const iter_impl< const BasicJsonType > & other

converting assignment

other

const iterator to copy from

const/non-const iterator

It is not checked whether other is initialized.

nlohmann::detail::iter_impl< BasicJsonType >::m_it
nlohmann::detail::iter_impl< BasicJsonType >::iter_impl
(const iter_impl< typename std::remove_const< BasicJsonType >::type > &other) noexcept
iter_impl
const iter_impl< typename std::remove_const< BasicJsonType >::type > & other

converting constructor

other

non-const iterator to copy from

It is not checked whether other is initialized.

iter_impl & iter_impl& nlohmann::detail::iter_impl< BasicJsonType >::operator= (const iter_impl< typename std::remove_const< BasicJsonType >::type > &other) noexcept operator= const iter_impl< typename std::remove_const< BasicJsonType >::type > & other

converting assignment

other

non-const iterator to copy from

const/non-const iterator

It is not checked whether other is initialized.

JSON_PRIVATE_UNLESS_TESTED
nlohmann::detail::iter_impl< BasicJsonType >::m_it
nlohmann::detail::iter_impl< BasicJsonType >::switch
(m_object->m_type)
switch
m_object-> m_type
nlohmann::detail::array
nlohmann::detail::null
nlohmann::detail::object
void void nlohmann::detail::iter_impl< BasicJsonType >::set_end () noexcept set_end

set the iterator past the last value

The iterator is initialized; i.e. `m_object != nullptr`.

nlohmann::detail::array
JSON_ASSERT
nlohmann::detail::object
nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >::cend
nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >::end
reference reference nlohmann::detail::iter_impl< BasicJsonType >::operator* () const operator*

return a reference to the value pointed to by the iterator

The iterator is initialized; i.e. `m_object != nullptr`.

nlohmann::detail::array
nlohmann::detail::invalid_iterator::create
JSON_ASSERT
JSON_HEDLEY_LIKELY
JSON_THROW
nlohmann::detail::null
nlohmann::detail::object
pointer pointer nlohmann::detail::iter_impl< BasicJsonType >::operator-> () const operator->

dereference the iterator

The iterator is initialized; i.e. `m_object != nullptr`.

nlohmann::detail::array
nlohmann::detail::invalid_iterator::create
JSON_ASSERT
JSON_HEDLEY_LIKELY
JSON_THROW
nlohmann::detail::object
iter_impl const iter_impl const nlohmann::detail::iter_impl< BasicJsonType >::operator++ (int) operator++ int

post-increment (it++)

The iterator is initialized; i.e. `m_object != nullptr`.

iter_impl & iter_impl& nlohmann::detail::iter_impl< BasicJsonType >::operator++ () operator++

pre-increment (++it)

The iterator is initialized; i.e. `m_object != nullptr`.

nlohmann::detail::array
JSON_ASSERT
nlohmann::detail::object
iter_impl const iter_impl const nlohmann::detail::iter_impl< BasicJsonType >::operator-- (int) operator-- int

post-decrement (it)

The iterator is initialized; i.e. `m_object != nullptr`.

iter_impl & iter_impl& nlohmann::detail::iter_impl< BasicJsonType >::operator-- () operator--

pre-decrement (it)

The iterator is initialized; i.e. `m_object != nullptr`.

nlohmann::detail::array
JSON_ASSERT
nlohmann::detail::object
typename IterImpl
detail::enable_if_t<(std::is_same< IterImpl, iter_impl >::value||std::is_same< IterImpl, other_iter_impl >::value), std::nullptr_t > nullptr
bool bool nlohmann::detail::iter_impl< BasicJsonType >::operator== (const IterImpl &other) const operator== const IterImpl & other

comparison: equal

The iterator is initialized; i.e. `m_object != nullptr`.

nlohmann::detail::array
nlohmann::detail::invalid_iterator::create
JSON_ASSERT
JSON_HEDLEY_UNLIKELY
JSON_THROW
nlohmann::detail::object
typename IterImpl
detail::enable_if_t<(std::is_same< IterImpl, iter_impl >::value||std::is_same< IterImpl, other_iter_impl >::value), std::nullptr_t > nullptr
bool bool nlohmann::detail::iter_impl< BasicJsonType >::operator!= (const IterImpl &other) const operator!= const IterImpl & other

comparison: not equal

The iterator is initialized; i.e. `m_object != nullptr`.

bool bool nlohmann::detail::iter_impl< BasicJsonType >::operator< (const iter_impl &other) const operator< const iter_impl & other

comparison: smaller

The iterator is initialized; i.e. `m_object != nullptr`.

nlohmann::detail::array
nlohmann::detail::internal_iterator< BasicJsonType >::array_iterator
nlohmann::detail::invalid_iterator::create
JSON_ASSERT
JSON_HEDLEY_UNLIKELY
JSON_THROW
nlohmann::detail::iter_impl< BasicJsonType >::m_it
nlohmann::detail::object
nlohmann::detail::internal_iterator< BasicJsonType >::primitive_iterator
bool bool nlohmann::detail::iter_impl< BasicJsonType >::operator<= (const iter_impl &other) const operator<= const iter_impl & other

comparison: less than or equal

The iterator is initialized; i.e. `m_object != nullptr`.

bool bool nlohmann::detail::iter_impl< BasicJsonType >::operator> (const iter_impl &other) const operator> const iter_impl & other

comparison: greater than

The iterator is initialized; i.e. `m_object != nullptr`.

bool bool nlohmann::detail::iter_impl< BasicJsonType >::operator>= (const iter_impl &other) const operator>= const iter_impl & other

comparison: greater than or equal

The iterator is initialized; i.e. `m_object != nullptr`.

nlohmann::detail::operator<
iter_impl & iter_impl& nlohmann::detail::iter_impl< BasicJsonType >::operator+= (difference_type i) operator+= difference_type i

add to iterator

The iterator is initialized; i.e. `m_object != nullptr`.

nlohmann::detail::array
nlohmann::detail::invalid_iterator::create
JSON_ASSERT
JSON_THROW
nlohmann::detail::object
iter_impl & iter_impl& nlohmann::detail::iter_impl< BasicJsonType >::operator-= (difference_type i) operator-= difference_type i

subtract from iterator

The iterator is initialized; i.e. `m_object != nullptr`.

iter_impl iter_impl nlohmann::detail::iter_impl< BasicJsonType >::operator+ (difference_type i) const operator+ difference_type i

add to iterator

The iterator is initialized; i.e. `m_object != nullptr`.

iter_impl iter_impl nlohmann::detail::iter_impl< BasicJsonType >::operator- (difference_type i) const operator- difference_type i

subtract from iterator

The iterator is initialized; i.e. `m_object != nullptr`.

difference_type difference_type nlohmann::detail::iter_impl< BasicJsonType >::operator- (const iter_impl &other) const operator- const iter_impl & other

return difference

The iterator is initialized; i.e. `m_object != nullptr`.

nlohmann::detail::array
nlohmann::detail::internal_iterator< BasicJsonType >::array_iterator
nlohmann::detail::invalid_iterator::create
JSON_ASSERT
JSON_THROW
nlohmann::detail::iter_impl< BasicJsonType >::m_it
nlohmann::detail::object
nlohmann::detail::internal_iterator< BasicJsonType >::primitive_iterator
reference reference nlohmann::detail::iter_impl< BasicJsonType >::operator[] (difference_type n) const operator[] difference_type n

access to successor

The iterator is initialized; i.e. `m_object != nullptr`.

nlohmann::detail::array
nlohmann::detail::invalid_iterator::create
JSON_ASSERT
JSON_HEDLEY_LIKELY
JSON_THROW
nlohmann::detail::null
nlohmann::detail::object
const object_t::key_type & const object_t::key_type& nlohmann::detail::iter_impl< BasicJsonType >::key () const key

return the key of an object iterator

The iterator is initialized; i.e. `m_object != nullptr`.

nlohmann::detail::invalid_iterator::create
JSON_ASSERT
JSON_HEDLEY_LIKELY
JSON_THROW
reference reference nlohmann::detail::iter_impl< BasicJsonType >::value () const value

return the value of an iterator

The iterator is initialized; i.e. `m_object != nullptr`.

JSON_PRIVATE_UNLESS_TESTED
friend iter_impl iter_impl operator+ (difference_type i, const iter_impl &it) operator+ difference_type i const iter_impl & it

addition of distance and iterator

The iterator is initialized; i.e. `m_object != nullptr`.

a template for a bidirectional iterator for the basic_json class This class implements a both iterators (iterator and const_iterator) for the basic_json class.

An iterator is called initialized when a pointer to a JSON value has been set (e.g., by a constructor or a copy assignment). If the iterator is default-constructed, it is uninitialized and most methods are undefined. The library uses assertions to detect calls on uninitialized iterators.** The class satisfies the following concept requirements:

- BidirectionalIterator: The iterator that can be moved can be moved in both directions (i.e. incremented and decremented).

version 1.0.0, simplified in version 2.0.9, change to bidirectional iterators in version 3.0.0 (see https://github.com/nlohmann/json/issues/593)

nlohmann::detail::iter_impl< BasicJsonType >
+m_it
+__pad0__
+__pad1__
-other_iter_impl
-iteration_proxy_value< iter_impl >
-iteration_proxy< iter_impl >
-BasicJsonType
iterator
JSON_PRIVATE_UNLESS_TESTED
static constexpr difference_type
nlohmann::detail::internal_iterator< typename std::remove_const< BasicJsonType >::type >
+array_iterator
+object_iterator
+primitive_iterator
< typename std::remove_const< BasicJsonType >::type >
nlohmann::detail::primitive_iterator_t
-end_value
-begin_value
-__pad0__
nlohmann::detail::internal_iterator< BasicJsonType >
+array_iterator
+object_iterator
+primitive_iterator
friend
- nlohmann::detail::iter_impl
  __pad0__
- nlohmann::detail::iter_impl
  __pad1__
- nlohmann::detail::iter_impl
  array_t
- nlohmann::detail::iter_impl
  BasicJsonType
- nlohmann::detail::iter_impl
  difference_type
- nlohmann::detail::iter_impl
  iter_impl
- nlohmann::detail::iter_impl
  iter_impl
- nlohmann::detail::iter_impl
  iter_impl
- nlohmann::detail::iter_impl
  iter_impl
- nlohmann::detail::iter_impl
  iter_impl
- nlohmann::detail::iter_impl
  iteration_proxy< iter_impl >
- nlohmann::detail::iter_impl
  iteration_proxy_value< iter_impl >
- nlohmann::detail::iter_impl
  iterator_category
- nlohmann::detail::iter_impl
  key
- nlohmann::detail::iter_impl
  m_it
- nlohmann::detail::iter_impl
  object_t
- nlohmann::detail::iter_impl
  operator!=
- nlohmann::detail::iter_impl
  operator*
- nlohmann::detail::iter_impl
  operator+
- nlohmann::detail::iter_impl
  operator+
- nlohmann::detail::iter_impl
  operator++
- nlohmann::detail::iter_impl
  operator++
- nlohmann::detail::iter_impl
  operator+=
- nlohmann::detail::iter_impl
  operator-
- nlohmann::detail::iter_impl
  operator-
- nlohmann::detail::iter_impl
  operator--
- nlohmann::detail::iter_impl
  operator--
- nlohmann::detail::iter_impl
  operator-=
- nlohmann::detail::iter_impl
  operator->
- nlohmann::detail::iter_impl
  operator<
- nlohmann::detail::iter_impl
  operator<=
- nlohmann::detail::iter_impl
  operator=
- nlohmann::detail::iter_impl
  operator=
- nlohmann::detail::iter_impl
  operator=
- nlohmann::detail::iter_impl
  operator==
- nlohmann::detail::iter_impl
  operator>
- nlohmann::detail::iter_impl
  operator>=
- nlohmann::detail::iter_impl
  operator[]
- nlohmann::detail::iter_impl
  other_iter_impl
- nlohmann::detail::iter_impl
  other_iter_impl
- nlohmann::detail::iter_impl
  pointer
- nlohmann::detail::iter_impl
  reference
- nlohmann::detail::iter_impl
  set_end
- nlohmann::detail::iter_impl
  switch
- nlohmann::detail::iter_impl
  value
- nlohmann::detail::iter_impl
  value_type
- nlohmann::detail::iter_impl
  ~iter_impl