JSON for Modern C++ 3.7.1

back
basic_json
empty
json_pointer
operator std::string
operator!=
operator/
operator/
operator/
operator/=
operator/=
operator/=
operator==
parent_pointer
pop_back
push_back
push_back
to_string
| ## ◆ back() template<typename BasicJsonType >
const std::string& nlohmann::json_pointer< BasicJsonType >::back | ( |  | ) | const
| inline
  Precondition not `empty()` Returns last reference token Example The example shows the usage of `back`. 1 #include <iostream> 2 #include <nlohmann/json.hpp> 3 4 using json = nlohmann::json; 5 6 int main() 7 { 8 // different JSON Pointers 9 json::json_pointer ptr1("/foo"); 10 json::json_pointer ptr2("/foo/0"); 11 12 // call empty() 13 std::cout << "last reference token of " << ptr1 << " is " << ptr1.back() << '\n' 14 << "last reference token of " << ptr2 << " is " << ptr2.back() << std::endl; 15 } Output (play with this example online):
      last reference token of "/foo" is foo
      last reference token of "/foo/0" is 0
  The example code above can be translated with
      g++ -std=c++11 -Isingle_include doc/examples/json_pointer__back.cpp -o json_pointer__back
  Complexity Constant. Exceptions
  out_of_range.405 | if JSON pointer has no parent
Since version 3.6.0 Definition at line 10344 of file json.hpp.

nlohmann::basic_json::json_pointer
::nlohmann::json_pointer< basic_json > json_pointer
JSON Pointer, see nlohmann::json_pointer.
Definition: json.hpp:14753
nlohmann::json
basic_json<> json
default JSON class
Definition: json.hpp:2445