We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I will start with an example:
class Doc { public: explicit Doc(const std::string &data) : m_doc{nlohmann::json::parse(data)} {} auto dump() const { return m_doc.dump(); } private: nlohmann::json m_doc; }; int main() { const std::string data{R"({"value": 1})"}; auto v = nlohmann::json::parse(data); std::cout << v.dump() << std::endl; // {"value":1} Doc d{data}; std::cout << d.dump() << std::endl; // [{"value":1}] return 0; }
Link for compiler explorer
Probably I missed something, but why do I always get an array in the second case using GCC? Clang is ok.
Expected behavior: output must be {"value":1} twice.
{"value":1}
Environment:
The text was updated successfully, but these errors were encountered:
Duplicate of #2583.
Sorry, something went wrong.
No branches or pull requests
I will start with an example:
Link for compiler explorer
Probably I missed something, but why do I always get an array in the second case using GCC? Clang is ok.
Expected behavior: output must be
{"value":1}
twice.Environment:
The text was updated successfully, but these errors were encountered: