code: ```c++ int i = 948; json scalar = i; std::cout << "<start>\n" << scalar.dump() << "\n<end>\n"; json record; record["scalar"] = scalar; std::cout << "<start>\n" << record.dump() << "\n<end>\n"; ``` g++ 7.2 output: ``` <start> 948 <end> <start> {"scalar":948} // ok <end> ``` MSVC 2017 with default c++ standard setting and "ISO C++14 Standard (/std:c++14)" output: ``` <start> 948 <end> <start> {"scalar":[948]} // why list? <end> ```
Activity
nlohmann commentedon Mar 19, 2020
Is that the exact code you run or are there some brace initializations somewhere?
toohes commentedon Mar 19, 2020
it is copypaste.
i spend some time for war with markdown.
toohes commentedon Mar 19, 2020
ups. i've found my bug. sorry.
toohes commentedon Mar 19, 2020
there was wrong typedef
typedef vr::jsn::Packet json;where
right typedef
typedef nlohmann::json json;has fixed bug.
nonetheless behavior of gcc and msvc is different.
remote work so remote.