-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
ambiguous regression #3204
Labels
kind: bug
release item: 🐛 bug fix
solution: proposed fix
a fix for the issue has been proposed and waits for confirmation
Milestone
Comments
This is still an issue in |
@alephzero Unfortunately I don't believe your issue is fixable in the short term. Above mentioned commit enabled the intended behavior of implicit string conversion so your only options are to either turn of implicit conversions (define #include <https://raw.githubusercontent.com/nlohmann/json/develop/single_include/nlohmann/json.hpp>
#include <functional>
#include <string>
struct Foo {
Foo() {}
Foo(std::string) {}
};
struct Bar {
// de-rank overload by making it a template
template<typename>
Bar(std::function<void(Foo)>) {}
Bar(std::function<void(nlohmann::json)>) {}
};
int main() {
Bar bar([](Foo) {});
} @nlohmann Thoughts? |
falbrechtskirchinger
added a commit
to falbrechtskirchinger/json
that referenced
this issue
Jul 30, 2022
falbrechtskirchinger
added a commit
to falbrechtskirchinger/json
that referenced
this issue
Jul 30, 2022
falbrechtskirchinger
added a commit
to falbrechtskirchinger/json
that referenced
this issue
Jul 30, 2022
nlohmann
added
solution: proposed fix
a fix for the issue has been proposed and waits for confirmation
release item: 🐛 bug fix
labels
Jul 30, 2022
nlohmann
pushed a commit
that referenced
this issue
Jul 31, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
kind: bug
release item: 🐛 bug fix
solution: proposed fix
a fix for the issue has been proposed and waits for confirmation
There was a regression between
v3.10.3
andv3.10.4
, in the compiler's ability to disambiguatestd::function
containingnlohmann::json
.In compiler explorer:
Generates
Changing the version to
v3.10.4
:Generates
The text was updated successfully, but these errors were encountered: