You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
json constructor does not support std::optional #2214
I'm using clang 9.0 which support C++17, but below codes can't pass compile when I use nlohmann::json:
std::optional<int> value;
auto json = nlohmann::json{{"opt", value}};
instead, I have to use below codes:
if (value) {
json = nlohmann::json{{"opt", *value}};
} else {
json = nlohmann::json{{"opt", nullptr}};
}
Activity
dota17 commentedon Jun 24, 2020
Please See #1749 .
There is a PR #2117 , but it didn't merge into
developbecause there are some problems.nlohmann commentedon Jun 24, 2020
Duplicate of #1749.