-
-
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
Surprising behaviour with overloaded operators #2256
Comments
I'm afraid this is another instance of #958... |
I'm not sure this is related to #958, but rather just the way that template argument deduction works. The
In the In the You should get the same behavior with this:
and then this:
If you were expecting
|
Nope. Your first snippet was my first attempt at a minimal example, and produces different results: |
Okay, so it has to do with multiple user defined conversions then. Either way, I would say it's still about template argument deduction. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
First of all, thanks for this project - it's amazingly useful.
It looks like you can work around it by using
to_json
, but I ran into this surprising behaviour with the below code on GCC 10.1 - I'd have expected either both values to be the same, or for the compiler to complain that it's ambiguous. Is what's happening intentional?Output:
{"a":"string","b":42}
The text was updated successfully, but these errors were encountered: