What is the issue you have?
Initialization seems to differ between clang and gcc (have not yet tried MSVC):
json j{json::object()};
std::cout << j << std::endl;
// GCC: [{}]
// clang: {}
I.e., in gcc this creates an array with an object as its first element; in clang it creates an object.
Please describe the steps to reproduce the issue.
Running example: https://godbolt.org/z/7r76TE
Can you provide a small but working code example?
As above.
What is the expected behavior?
Consistent initialization between compilers for the same code.
And what is the actual behavior instead?
Different values per compiler.
Which compiler and operating system are you using?
- Compiler: clang 10, gcc 10.1
- Operating system: Linux
- std: c++17
Which version of the library did you use?
What is the issue you have?
Initialization seems to differ between clang and gcc (have not yet tried MSVC):
json j{json::object()}; std::cout << j << std::endl; // GCC: [{}] // clang: {}I.e., in gcc this creates an array with an object as its first element; in clang it creates an object.
Please describe the steps to reproduce the issue.
Running example: https://godbolt.org/z/7r76TE
Can you provide a small but working code example?
As above.
What is the expected behavior?
Consistent initialization between compilers for the same code.
And what is the actual behavior instead?
Different values per compiler.
Which compiler and operating system are you using?
Which version of the library did you use?
developbranch