Merge pull request #1434 from pboettch/develop

allow push_back() and pop_back() calls on json_pointer
This commit is contained in:
Niels Lohmann 2019-01-19 17:07:36 +01:00 committed by GitHub
commit b9a39b38bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 74 additions and 2 deletions

View file

@ -97,7 +97,6 @@ class json_pointer
return res;
}
private:
/*!
@brief remove and return last reference pointer
@throw out_of_range.405 if JSON pointer has no parent
@ -114,6 +113,16 @@ class json_pointer
return last;
}
/*!
@brief remove and return last reference pointer
@throw out_of_range.405 if JSON pointer has no parent
*/
void push_back(const std::string& tok)
{
reference_tokens.push_back(tok);
}
private:
/// return whether pointer points to the root document
bool is_root() const noexcept
{