kazuho/picojson

No operator[] for const object

JetForMe opened this issue · 2 comments

If I get a const reference to an object type, I can't use [] to get at its elements. I have to make a non-const copy.

Do you have a simple test-case that reproduces the problem?

It seems like a problem in your code, considering the fact that picojson::object is a typedef of std::map<std::string, value>. The operator is defined by std::map.

Ah, it turns out this is a quirk of STL. Sorry for the noise.