Skip to content

Commit

Permalink
Remove basic_json proxy test
Browse files Browse the repository at this point in the history
  • Loading branch information
danielaparker committed Nov 1, 2024
1 parent 3b7f1eb commit 5b55a96
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
25 changes: 10 additions & 15 deletions doc/ref/corelib/json/operator_at.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
### jsoncons::basic_json::operator[]

```cpp
proxy_type operator[](const string_view_type& key); (1)
proxy_type operator[](const string_view_type& key); (1) (until 0.179.0)
basic_json& operator[](const string_view_type& key); (since 0.179.0)

const_reference operator[](const string_view_type& key) const; (2)
const_reference operator[](const string_view_type& key) const; (2)

reference operator[](std::size_t i); (3)
reference operator[](std::size_t i); (3)

const_reference operator[](std::size_t i) const; (4)
const_reference operator[](std::size_t i) const; (4)
```

(1) Returns a "reference-like" proxy object that can be used to access
or assign to the underlying keyed value. Type `proxy_type` supports
the `basic_json` interface and conversion to `basic_json&`. If accessing
and the key exists, evaluates to a reference to the keyed value.If
accessing and the key does not exist, `noexcept` accessors return a
default value, e.g. the `is_xxx` functions return `false`, other
accessors throw.
If assigning, inserts or updates with the new value.
Throws `std::domain_error` if not an object.
If read, throws `std::out_of_range` if the object does not have a
member with the specified key.
(1) Unitl 0.179.0, returns a "reference-like" proxy object that can be used to access
or assign to the underlying keyed value.

Since 0.179, returns a reference to the value that is associated with `key`,
performing an insertion if no such `key` exists.

(2) If `key` matches the key of a member in the basic_json object, returns a reference to the basic_json object, otherwise throws.
Throws `std::domain_error` if not an object.
Expand Down
1 change: 0 additions & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ add_executable(unit_tests
corelib/src/json_parse_error_tests.cpp
corelib/src/json_parser_position_tests.cpp
corelib/src/json_parser_tests.cpp
corelib/src/json_proxy_tests.cpp
corelib/src/json_push_back_tests.cpp
corelib/src/json_reader_exception_tests.cpp
corelib/src/json_reader_tests.cpp
Expand Down

0 comments on commit 5b55a96

Please sign in to comment.