This commit is contained in:
nlohmann committed 2026-10-12 07:35:31 +00:00
1 parent 79119509a9
commit 22fba27145
555 files changed
+17342 -1394

No files matched your search

+27 -2
View File
@@ -28,13 +28,38 @@ Amortized constant.
The example shows the result of `push_back` for different JSON Pointers.
```cpp
--8<-- "examples/json_pointer__push_back.cpp"
#include <iostream>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
int main()
{
// create empty JSON Pointer
json::json_pointer ptr;
std::cout << "\"" << ptr << "\"\n";
// call push_back()
ptr.push_back("foo");
std::cout << "\"" << ptr << "\"\n";
ptr.push_back("0");
std::cout << "\"" << ptr << "\"\n";
ptr.push_back("bar");
std::cout << "\"" << ptr << "\"\n";
}
```
Output:
```json
--8<-- "examples/json_pointer__push_back.output"
""
"/foo"
"/foo/0"
"/foo/0/bar"
```
## See also