ADL should be inhibited by default for non-operators #781
KendallHarter
started this conversation in
Suggestions
Replies: 2 comments 3 replies
|
I'm curious, why is ADL a pitfall in generic code? |
3 replies
|
For reference, here's the A non-Cpp1 compiler tool like Cppfront would require you to qualify (almost) all unqualified function names with Maybe it'd be better to invest in a Clang-Tidy check that can be used from Cpp2. f(2);/*adl*/
f( g(2));/*adl*/ |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Currently, the emitted function calls from cppfront are subject to ADL, which is a common pitfall in generic code, to the point that the standard ranges library is defined such that much of it does not participate in ADL. By having some syntax that explicitly requests ADL it makes it much clearer when ADL is being intentionally used and makes generic code easier to write without needing to fully qualify almost every function call to have it be always correct.
All reactions