mirror of
https://github.com/nlohmann/json.git
synced 2026-02-09 23:52:15 +00:00
Make json_pointer::back const (resolves #1764)
This commit is contained in:
@@ -559,6 +559,10 @@ TEST_CASE("JSON pointers")
|
||||
CHECK(!ptr.empty());
|
||||
CHECK(j[ptr] == j["answer"]["everything"]);
|
||||
|
||||
// check access via const pointer
|
||||
const auto cptr = ptr;
|
||||
CHECK(cptr.back() == "everything");
|
||||
|
||||
ptr.pop_back();
|
||||
ptr.pop_back();
|
||||
CHECK(ptr.empty());
|
||||
|
||||
Reference in New Issue
Block a user