This commit is contained in:
nlohmann committed 2026-10-26 21:24:35 +00:00
1 parent 41c601a7d1
commit d2e264bd84
1400 files changed
+11859 -5440

No files matched your search

+4 -3
View File
@@ -12,7 +12,8 @@ Parent of this JSON pointer; in case this JSON pointer is the root, the root its
## Exception safety
No-throw guarantee: this function never throws exceptions.
Strong exception safety: if an exception occurs, the original value stays intact. The function is not `#!cpp noexcept`
and allocates a new JSON pointer, so it can throw `#!cpp std::bad_alloc`; it throws no library exceptions.
## Complexity
@@ -28,7 +29,7 @@ Linear in the length of the JSON pointer.
#include <iostream>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
using nlohmann::json;
int main()
{
@@ -41,7 +42,7 @@ Linear in the length of the JSON pointer.
std::cout << std::boolalpha
<< "parent of \"" << ptr1 << "\" is \"" << ptr1.parent_pointer() << "\"\n"
<< "parent of \"" << ptr2 << "\" is \"" << ptr2.parent_pointer() << "\"\n"
<< "parent of \"" << ptr3 << "\" is \"" << ptr3.parent_pointer() << "\"" << std::endl;
<< "parent of \"" << ptr3 << "\" is \"" << ptr3.parent_pointer() << "\"" << '\n';
}
```