diff --git a/doc/mkdocs/docs/api/basic_json/back.md b/doc/mkdocs/docs/api/basic_json/back.md index 4975f1531..1a715284d 100644 --- a/doc/mkdocs/docs/api/basic_json/back.md +++ b/doc/mkdocs/docs/api/basic_json/back.md @@ -33,6 +33,12 @@ If the JSON value is `#!json null`, exception Constant. +## Notes + +!!! info "Precondition" + + The array or object must not be empty. Calling `back` on an empty array or object yields undefined behavior. + ## Examples ??? example diff --git a/doc/mkdocs/docs/api/basic_json/front.md b/doc/mkdocs/docs/api/basic_json/front.md index ce7460474..e258c36a0 100644 --- a/doc/mkdocs/docs/api/basic_json/front.md +++ b/doc/mkdocs/docs/api/basic_json/front.md @@ -26,6 +26,12 @@ If the JSON value is `#!json null`, exception Constant. +## Notes + +!!! info "Precondition" + + The array or object must not be empty. Calling `front` on an empty array or object yields undefined behavior. + ## Examples ??? example diff --git a/doc/mkdocs/docs/api/basic_json/object_comparator_t.md b/doc/mkdocs/docs/api/basic_json/object_comparator_t.md index 44509a94b..e2bc79d05 100644 --- a/doc/mkdocs/docs/api/basic_json/object_comparator_t.md +++ b/doc/mkdocs/docs/api/basic_json/object_comparator_t.md @@ -8,7 +8,7 @@ using object_comparator_t = std::less<>; // since C++14 The comparator used in [`object_t`](object_t.md). -When C++14 is detected, a transparent com parator is used which, when combined with perfect forwarding on find() and +When C++14 is detected, a transparent comparator is used which, when combined with perfect forwarding on find() and count() calls, prevents unnecessary string construction. ## Version history diff --git a/doc/mkdocs/docs/api/macros/json_no_io.md b/doc/mkdocs/docs/api/macros/json_no_io.md index 52baefc66..10ae24c8a 100644 --- a/doc/mkdocs/docs/api/macros/json_no_io.md +++ b/doc/mkdocs/docs/api/macros/json_no_io.md @@ -5,7 +5,7 @@ ``` When defined, headers ``, ``, ``, ``, and `` are not included and parse functions -relying on these headers are excluded. This is relevant for environment where these I/O functions are disallowed for +relying on these headers are excluded. This is relevant for environments where these I/O functions are disallowed for security reasons (e.g., Intel Software Guard Extensions (SGX)). ## Default definition diff --git a/doc/mkdocs/docs/features/assertions.md b/doc/mkdocs/docs/features/assertions.md index 0c13426a9..a0b118722 100644 --- a/doc/mkdocs/docs/features/assertions.md +++ b/doc/mkdocs/docs/features/assertions.md @@ -20,7 +20,7 @@ before including the `json.hpp` header. Function [`operator[]`](../api/basic_json/operator%5B%5D.md) implements unchecked access for objects. Whereas a missing key is added in case of non-const objects, accessing a const object with a missing key is undefined behavior (think of a -dereferenced null pointer) and yields an runtime assertion. +dereferenced null pointer) and yields a runtime assertion. If you are not sure whether an element in an object exists, use checked access with the [`at` function](../api/basic_json/at.md) or call the [`contains` function](../api/basic_json/contains.md) before.