-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Conversion operator for nlohmann::json is not SFINAE friendly #1237
Labels
solution: proposed fix
a fix for the issue has been proposed and waits for confirmation
Milestone
Comments
theodelrieu
added a commit
to theodelrieu/json
that referenced
this issue
Sep 12, 2018
* Make the conversion operator SFINAE correct. * Workaround a GCC bug with some traits in type_traits.hpp
theodelrieu
added a commit
to theodelrieu/json
that referenced
this issue
Sep 12, 2018
* Make the conversion operator SFINAE correct. * Workaround a GCC bug with some traits in type_traits.hpp The first bullet-point implies that every `get`/`get_ptr` be SFINAE correct as well.
theodelrieu
added a commit
to theodelrieu/json
that referenced
this issue
Sep 13, 2018
* Make the conversion operator SFINAE correct. * Workaround a GCC bug with some traits in type_traits.hpp The first bullet-point implies that every `get`/`get_ptr` be SFINAE correct as well.
theodelrieu
added a commit
to theodelrieu/json
that referenced
this issue
Sep 20, 2018
* Make the conversion operator SFINAE correct. * Workaround a GCC bug with some traits in type_traits.hpp The first bullet-point implies that every `get`/`get_ptr` be SFINAE correct as well.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nlohmann::json
's conversion operator is mis-behaved. It pretends to be convertible to things that it is not actually convertible to, which causes errors when using generic libraries that rely on these checks.In the following program, the
static_assert
passes becausestd::is_convertible
checks whether there's a conversion operator for the given type. However, when actually trying to instantiate the conversion operator, we fail because no viableget
function can be found:The error message is
The
static_assert
should fail instead.The
static_assert
passes, lying aboutnlohmann::json
being convertible toMyType
.All Clangs fail.
develop
branch?Released version.
Yes.
The text was updated successfully, but these errors were encountered: