From b16fc855a3d1171af18a712dbeb91ab0c1219d0a Mon Sep 17 00:00:00 2001 From: Yixin Dong Date: Mon, 11 Nov 2024 00:56:50 -0500 Subject: [PATCH] [3rdparty] Update Picojson with const `operator[]` function This PR adds a `const value& operator[](const std::string& key) const` method to picojson object --- 3rdparty/picojson/picojson.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/3rdparty/picojson/picojson.h b/3rdparty/picojson/picojson.h index 5ecffa9a8f30..69d3045ea554 100644 --- a/3rdparty/picojson/picojson.h +++ b/3rdparty/picojson/picojson.h @@ -273,6 +273,10 @@ class object_with_ordered_keys : private std::unordered_map return std::unordered_map::operator[](key); } + const value& operator[](const std::string& key) const { + return std::unordered_map::at(key); + } + void clear() { std::unordered_map::clear(); ordered_keys_.clear();