-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Closed
Description
I seem to have hit a bug in either this library / MSVC. Here's a minimal repro case:
struct MyObj {
json mJson;
explicit MyObj(json const& input) : mJson{input} {}
};
json j = json::object();
j["foo"] = "bar";
j["baz"] = "ba";
auto x = std::make_shared<MyObj>(j);
std::cout << obj->mJson.dump() << std::endl;
Output:
J: {"baz":"bah","foo":"bar"}
J: [{"baz":"bah","foo":"bar"}]
Interestingly, changing the initialiser from mJson{input} to mJson(input) produces the correct output:
J: {"baz":"bah","foo":"bar"}
J: {"baz":"bah","foo":"bar"}
I'm currently using 3.1.2 but confirmed it also reproduces on latest 3.4.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels