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
It works in OSX with clang. IMHO it's supposed to work in Linux. The {} initializer is supposed to be valid.
And what is the actual behavior instead?
It crashes with:
[json.exception.type_error.305] cannot use operator[] with a string argument with array
Which compiler and operating system are you using? Is it a supported compiler?
It works with clang: Apple LLVM version 10.0.0 (clang-1000.11.45.5) in OSX.
It fails in Linux Debian with gcc 4.9.2
Did you use a released version of the library or the version from the develop branch?
No. Using 3.5.0.
Important:
It works this way:
json data = json::object();
// or
json data = json::value_t::object;
// or
json data(json::value_t::object);
// or
json data(json::object());
data["foo"] = 1234;
So it looks like, when in gcc, the { } initializer is being interpreted as an array, am I right? Is this expected behavior?
The text was updated successfully, but these errors were encountered:
ibc
changed the title
json.exception.type_error.305 with GCC 4.9 when using {} initializer
json.exception.type_error.305 with GCC 4.9 when using C++ {} initializer
Jan 26, 2019
Code that runs in OSX with clang compiler fails in Linux Debian with gcc 4.9.2.
This simple code:
It works in OSX with clang. IMHO it's supposed to work in Linux. The
{}
initializer is supposed to be valid.It crashes with:
It works with clang: Apple LLVM version 10.0.0 (clang-1000.11.45.5) in OSX.
It fails in Linux Debian with gcc 4.9.2
develop
branch?No. Using 3.5.0.
Important:
It works this way:
So it looks like, when in gcc, the
{ }
initializer is being interpreted as an array, am I right? Is this expected behavior?The text was updated successfully, but these errors were encountered: