Doğan Ulus
Doğan Ulus
Now I think of that a commutative hash function (e.g. simple xor'ing) would work for `json::object`. I am not sure about the quality of hashing as I do not have...
Here is my implementation. Open to suggestions. ```cpp inline std::size_t combine(std::size_t seed, std::size_t h) { seed ^= h + 0x9e3779b9 + (seed > 2U); return seed; } inline std::size_t combine_comm(std::size_t...
I think I have needed some clarifications regarding the desired equality behavior of `json::value`. Since I only follow here, it may have been already discussed in other places but here...
That's almost clear to me. First I thought the inequality of hash values of `7` and `7.0` while they compare equal by `operator==` could be an exception for that rule....
More basic than that. I was talking about `std::hash{}(7) != std::hash{}(7.0)` while `7 == 7.0`.
Yes, non-existent objects are to be created at the insertion. For example, ```cpp value jv1 {{"a": {{"b", 1}}}}; value jv2 {{"c": {{"d", 2}}}}; jv1.insert_or_assign("/x", jv2); jv1.insert_or_assign("/a/b", jv2); assert(jv1.at_pointer"/x/c/d" == 2)...
Further investigations with the current API: For objects: ```cpp value jv = {{"abc", {{"xyz", {12, 13, 15}}}}}; jv.at_pointer("/abc/xyz") = {"123", "1231"}; // works as desired jv.at_pointer("/abc/klm") = {"123", "1231"}; //...
(1) yes, (3) no. Still, there might be some rough edges regarding (1) though as it is not only limited to `null` values but all values that are not objects....
RapidJSON implements the behavior (3). The program below is problematic as @pdimov points. ```cpp #include "rapidjson/document.h" #include "rapidjson/pointer.h" using namespace rapidjson; int main() { const char* json = R"({"my_obj": {...
Ah equality over wires... ok, got it.