Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uniform initialization causes problems with gcc #22

Closed
WojciechMigda opened this issue Dec 1, 2018 · 4 comments
Closed

Uniform initialization causes problems with gcc #22

WojciechMigda opened this issue Dec 1, 2018 · 4 comments

Comments

@WojciechMigda
Copy link
Contributor

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: nlohmann/json#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.

@nikhedonia
Copy link
Contributor

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 ?

@WojciechMigda
Copy link
Contributor Author

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!

@njlr
Copy link
Contributor

njlr commented Dec 6, 2018

Merged. Please close out as appropriate.

@WojciechMigda
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants