MCPcopy Create free account
hub / github.com/AllentDan/LibtorchTutorials / set_begin

Method set_begin

lesson6-Segmentation/json.hpp:10940–10971  ·  view source on GitHub ↗

! @brief set the iterator to the first value @pre The iterator is initialized; i.e. `m_object != nullptr`. */

Source from the content-addressed store, hash-verified

10938 @pre The iterator is initialized; i.e. `m_object != nullptr`.
10939 */
10940 void set_begin() noexcept
10941 {
10942 JSON_ASSERT(m_object != nullptr);
10943
10944 switch (m_object->m_type)
10945 {
10946 case value_t::object:
10947 {
10948 m_it.object_iterator = m_object->m_value.object->begin();
10949 break;
10950 }
10951
10952 case value_t::array:
10953 {
10954 m_it.array_iterator = m_object->m_value.array->begin();
10955 break;
10956 }
10957
10958 case value_t::null:
10959 {
10960 // set to end so begin()==end() is true: null is empty
10961 m_it.primitive_iterator.set_end();
10962 break;
10963 }
10964
10965 default:
10966 {
10967 m_it.primitive_iterator.set_begin();
10968 break;
10969 }
10970 }
10971 }
10972
10973 /*!
10974 @brief set the iterator past the last value

Callers 2

beginFunction · 0.45
cbeginFunction · 0.45

Calls 2

beginMethod · 0.80
set_endMethod · 0.45

Tested by

no test coverage detected