Closed WojciechMigda closed 5 years ago
Thanks, that's interesting! Does it work in gcc 8?
As an exercise I have removed uniform initialization from either.hpp
Can you make a PR ?
Hi, g++ 8.1 on coliru shows that g++ is stil doing universal initialization wrong: http://coliru.stacked-crooked.com/a/81b996265763eb16 I will follow up with a PR. Thanks!
Merged. Please close out as appropriate.
Thanks!
Uniform initialization (curly braces initialization) is being used in
either.hpp
, and while there should be nothing wrong with that some compilers do not handle this well.For instance, uniform initialization causes problems with nlohmann's json library compiled with gcc, as backed with this issue: https://github.com/nlohmann/json/issues/985
So, using neither with gcc and json objects causes the latter being modified.
As an excercise I have removed uniform initialization from either.hpp and after that Either wrapped around json I was playing with worked as expected.