error: ‘ordered_json’ in namespace ‘nlohmann’ does not name a type #2380
Answered
by
nlohmann
SrideviRamesh
asked this question in
Q&A
-
I want to make use of both json and ordered_json in my implementation please do help..Thanks in advance test.cpp #include <nlohmann/json.hpp>
#include <iostream>
using json = nlohmann::json;
using ordered_json = nlohmann::ordered_json;
int main()
{
ordered_json stringdata;
stringdata["name"] = "Jan"
stringdata["age"] = 20
std::cout << stringdata.dump(4) << std::endl;
} |
Beta Was this translation helpful? Give feedback.
Answered by
nlohmann
Sep 2, 2020
Replies: 1 comment 4 replies
-
I cannot reproduce this with Xcode 12 using the current {
"name": "Jan",
"age": 20
} |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
SrideviRamesh
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I cannot reproduce this with Xcode 12 using the current
develop
branch. After adding semicolons to lines 9 and 10, the program compiles and produces