While updating to 3.1.0, I noticed that the behavior of the library is not consistent with the documentation anymore for objects with non-unique names (also discussed in issue #375).
When the names within an object are not unique, later stored name/value pairs overwrite previously stored name/value pairs, leaving the used names unique. For instance, {"key": 1} and {"key": 2, "key": 1} will be treated as equal and both stored as {"key": 1}.
Whereas it will now be treated equally as {"key": 2} instead.
I bissected to the commit 85c7680 replacing operator[] with emplace to insert an object, which will not update an already existing object in the map.
I actually don't need this "feature" anymore, so not sure if it's best to fix the code for consistency or update the corresponding documentation.
While updating to 3.1.0, I noticed that the behavior of the library is not consistent with the documentation anymore for objects with non-unique names (also discussed in issue #375).
Whereas it will now be treated equally as
{"key": 2}instead.I bissected to the commit 85c7680 replacing
operator[]withemplaceto insert an object, which will not update an already existing object in themap.I actually don't need this "feature" anymore, so not sure if it's best to fix the code for consistency or update the corresponding documentation.