Skip to content

Commit 7b082ca

Browse files
authored
Fix ambiguous operator[] (#6)
* Fix ambiguous operator[] * template typo lol
1 parent 1770090 commit 7b082ca

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cppjson/include/cppjson/object.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ namespace cppjson
9898
}
9999

100100
ObjectProxy operator[](const std::string& key);
101+
template <std::size_t N>
102+
ObjectProxy operator[](const char(&key)[N]) { return (*this)[std::string{key}]; }
101103
private:
102104
std::reference_wrapper<JsonObject> _object;
103105

0 commit comments

Comments
 (0)