MCPcopy Create free account
hub / github.com/danielaparker/jsoncons / insert

Function insert

include/jsoncons/basic_json.hpp:4563–4576  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4561
4562 template <typename T>
4563 array_iterator insert(const_array_iterator pos, T&& val)
4564 {
4565 switch (storage_kind())
4566 {
4567 case json_storage_kind::array:
4568 return cast<array_storage>().value().insert(pos, std::forward<T>(val));
4569 break;
4570 case json_storage_kind::json_ref:
4571 return cast<json_ref_storage>().value().insert(pos, std::forward<T>(val));
4572 break;
4573 default:
4574 JSONCONS_THROW(json_runtime_error<std::domain_error>("Attempting to insert into a value that is not an array"));
4575 }
4576 }
4577
4578 template <typename InputIt>
4579 array_iterator insert(const_array_iterator pos, InputIt first, InputIt last)

Callers

nothing calls this directly

Calls 4

storage_kindFunction · 0.85
create_object_implicitlyFunction · 0.85
insertMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected