-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Closed
Labels
kind: questionsolution: proposed fixa fix for the issue has been proposed and waits for confirmationa fix for the issue has been proposed and waits for confirmation
Description
This simple code crashes:
string someStr;
json j = json::object();
// the next line crashes
j["someKey"] = someStr.empty() ? nullptr : someStr;
However, if I use standard if-else condition, everything is fine:
string someStr;
json j = json::object();
// the code below works ok
if (someStr.empty()) j["someKey"] = nullptr;
else j["someKey"] = someStr;
Also if S is not empty - both versions work.
Is it a bug or feature? :)
I'm using GNU C++ 14 compiler, IDE Xcode 9.3
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
kind: questionsolution: proposed fixa fix for the issue has been proposed and waits for confirmationa fix for the issue has been proposed and waits for confirmation