MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / operator->

Method operator->

Source/Utils/json.hpp:11043–11071  ·  view source on GitHub ↗

! @brief dereference the iterator @pre The iterator is initialized; i.e. `m_object != nullptr`. */

Source from the content-addressed store, hash-verified

11041 @pre The iterator is initialized; i.e. `m_object != nullptr`.
11042 */
11043 pointer operator->() const
11044 {
11045 JSON_ASSERT(m_object != nullptr);
11046
11047 switch (m_object->m_type)
11048 {
11049 case value_t::object:
11050 {
11051 JSON_ASSERT(m_it.object_iterator != m_object->m_value.object->end());
11052 return &(m_it.object_iterator->second);
11053 }
11054
11055 case value_t::array:
11056 {
11057 JSON_ASSERT(m_it.array_iterator != m_object->m_value.array->end());
11058 return &*m_it.array_iterator;
11059 }
11060
11061 default:
11062 {
11063 if (JSON_HEDLEY_LIKELY(m_it.primitive_iterator.is_begin()))
11064 {
11065 return m_object;
11066 }
11067
11068 JSON_THROW(invalid_iterator::create(214, "cannot get value"));
11069 }
11070 }
11071 }
11072
11073 /*!
11074 @brief post-increment (it++)

Callers

nothing calls this directly

Calls 3

createFunction · 0.85
is_beginMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected