MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / insert

Function insert

third-party/nlohmann/include/nlohmann/json.hpp:3021–3037  ·  view source on GitHub ↗

@brief inserts element into array @sa https://json.nlohmann.me/api/basic_json/insert/

Source from the content-addressed store, hash-verified

3019 /// @brief inserts element into array
3020 /// @sa https://json.nlohmann.me/api/basic_json/insert/
3021 iterator insert(const_iterator pos, const basic_json& val)
3022 {
3023 // insert only works for arrays
3024 if (JSON_HEDLEY_LIKELY(is_array()))
3025 {
3026 // check if iterator pos fits to this JSON value
3027 if (JSON_HEDLEY_UNLIKELY(pos.m_object != this))
3028 {
3029 JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value", *this));
3030 }
3031
3032 // insert to array and return iterator
3033 return insert_iterator(pos, val);
3034 }
3035
3036 JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()), *this));
3037 }
3038
3039 /// @brief inserts element into array
3040 /// @sa https://json.nlohmann.me/api/basic_json/insert/

Callers 1

insertMethod · 0.85

Calls 8

is_arrayFunction · 0.85
createFunction · 0.85
insert_iteratorFunction · 0.85
type_nameFunction · 0.85
is_objectFunction · 0.85
beginMethod · 0.80
endMethod · 0.80
insertMethod · 0.80

Tested by

no test coverage detected