You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by tq...@apache.org on 2024/11/15 15:14:59 UTC
(tvm) branch main updated: [3rdparty] Update Picojson with const `operator[]` function (#327) (#17532)
This is an automated email from the ASF dual-hosted git repository.
tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push:
new ae83479177 [3rdparty] Update Picojson with const `operator[]` function (#327) (#17532)
ae83479177 is described below
commit ae83479177a47f3b43dfdaf1f13983b10ac49845
Author: Ruihang Lai <ru...@cs.cmu.edu>
AuthorDate: Fri Nov 15 10:14:53 2024 -0500
[3rdparty] Update Picojson with const `operator[]` function (#327) (#17532)
[3rdparty] Update Picojson with const `operator[]` function
This PR adds a `const value& operator[](const std::string& key) const`
method to picojson object
Co-authored-by: Yixin Dong <ub...@gmail.com>
---
3rdparty/picojson/picojson.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/3rdparty/picojson/picojson.h b/3rdparty/picojson/picojson.h
index 5ecffa9a8f..69d3045ea5 100644
--- a/3rdparty/picojson/picojson.h
+++ b/3rdparty/picojson/picojson.h
@@ -273,6 +273,10 @@ class object_with_ordered_keys : private std::unordered_map<std::string, value>
return std::unordered_map<std::string, value>::operator[](key);
}
+ const value& operator[](const std::string& key) const {
+ return std::unordered_map<std::string, value>::at(key);
+ }
+
void clear() {
std::unordered_map<std::string, value>::clear();
ordered_keys_.clear();