TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ parent_pointer()

template<typename BasicJsonType >
json_pointer nlohmann::json_pointer< BasicJsonType >::parent_pointer ( ) const
inline

returns the parent of this JSON pointer

Returns
parent of this JSON pointer; in case this JSON pointer is the root, the root itself is returned

@complexity Linear in the length of the JSON pointer.

@liveexample{The example shows the result of parent_pointer for different JSON Pointers.,json_pointer__parent_pointer}

Since
version 3.6.0

Definition at line 12766 of file json.hpp.

12767 {
12768 if (empty())
12769 {
12770 return *this;
12771 }
12772
12773 json_pointer res = *this;
12774 res.pop_back();
12775 return res;
12776 }
bool empty() const noexcept
return whether pointer points to the root document
Definition: json.hpp:12862
json_pointer(const std::string &s="")
create JSON pointer
Definition: json.hpp:12591