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

Avoid conflict with std::apply (C++17) #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

e4z9
Copy link

@e4z9 e4z9 commented Mar 3, 2024

For example when calling the multiple cell version of lift the compiler tries to resolve the calls to apply(map(fa), bb) with std::apply(_Fn && __f, _Tuple && __t) and (understandably) fails to interpret sodium::cell as a tuple.

For example when calling the multiple cell version of `lift`
the compiler tries to resolve the calls to `apply(map(fa), bb)` with
`std::apply(_Fn && __f, _Tuple && __t)` and (understandably) fails to
interpret `sodium::cell` as a tuple.
@e4z9
Copy link
Author

e4z9 commented Mar 3, 2024

Maybe someone with more C++ foo has an idea why that happens in the first place even when not using using namespace std;

@geniusisme
Copy link

geniusisme commented Dec 5, 2024

This is ADL (argument-dependent lookup) at work. It sees that the argument sodium::cell<std::function<...>> is related to std and includes std functions in the lookup. Then, it depends on particularities of arguments if one of the functions is a better match or there is an ambiguity. Honestly, it is hard with templates everywhere to predict what would be the result of such a lookup.

Anyway, it seems I'm a little late to the party and the project is abandoned. Which is a shame, as it seems there is no replacement.

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

Successfully merging this pull request may close these issues.

2 participants