mirror of
https://github.com/nlohmann/json.git
synced 2025-07-29 23:01:16 +03:00
Rename private json_pointer::is_root as public json_pointer::empty for consistency with std::filesystem::path
This commit is contained in:
@ -149,7 +149,7 @@ class json_pointer
|
||||
*/
|
||||
std::string pop_back()
|
||||
{
|
||||
if (JSON_UNLIKELY(is_root()))
|
||||
if (JSON_UNLIKELY(empty()))
|
||||
{
|
||||
JSON_THROW(detail::out_of_range::create(405, "JSON pointer has no parent"));
|
||||
}
|
||||
@ -173,16 +173,16 @@ class json_pointer
|
||||
reference_tokens.push_back(std::move(token));
|
||||
}
|
||||
|
||||
private:
|
||||
/// return whether pointer points to the root document
|
||||
bool is_root() const noexcept
|
||||
bool empty() const noexcept
|
||||
{
|
||||
return reference_tokens.empty();
|
||||
}
|
||||
|
||||
private:
|
||||
json_pointer top() const
|
||||
{
|
||||
if (JSON_UNLIKELY(is_root()))
|
||||
if (JSON_UNLIKELY(empty()))
|
||||
{
|
||||
JSON_THROW(detail::out_of_range::create(405, "JSON pointer has no parent"));
|
||||
}
|
||||
|
Reference in New Issue
Block a user