-
Notifications
You must be signed in to change notification settings - Fork 70
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
call to 'advance' is ambiguous #43
Comments
I don't think the test case is correct. You can't expect unqualified I think the right thing to do is to fix user's code (or range-v3) so that it doesn't call unqualified |
I'll note here that the test case has no range-v3 code in it. The right thing to do would be for Boost to not add an overload of |
|
I don't think you're really understanding the issue. As @wickedmic pointed out above, the version of
So an unqualified call to The way to make this work is to turn |
Sorry, I was thinking that ADL does not consider using-declarations, but apparently it only doesn't consider using-directives. Making |
IIRC, Boost.Iterator has never advertised
+1 and #44. |
Thanks Michael and Eric for reporting and pointing out the problem. |
I had to revert the change as it broke building Boost. |
It seems that Boost.Range's This sample code fails to compile:
|
Iterator's boost::advance should be enable_if-ed on the category being one of Iterator's. (An object won't work - can't overload an object with Range's function.) |
Looking at
is_convertible<Cat, incrementable_traversal_tag> .
|
... and it seems that we'll also have to Tricky. |
A possible fix: This code compiles fine:
|
Regarding constraints on the first template parameter of |
Yes, I agree. |
Nice. Thanks guys. |
I upgraded my boost library from 1.62 to 1.67 (issue remains with 1.68) and now I'm getting "call to 'advance' is ambiguous". After some investigation it looks like a using statment in boost/iterator/advance.hpp:80 is causing the issue. The problem arises if
advance
is called unqualified, so that ADL triggers.boost
1.65 seems to be the first release with this issue.In my case this means that I cannot use range-v3 (this lib is making the unqualified call to advance) together with boost geometry (this uses boost-iterator's advance function and therefor includes boost/iterator/advance.hpp).
Here is a minimal code example, which causes this issue:
https://godbolt.org/z/rSfeVi
The text was updated successfully, but these errors were encountered: