ADL should be inhibited by default for non-operators #781
Replies: 2 comments 3 replies
-
I'm curious, why is ADL a pitfall in generic code? |
Beta Was this translation helpful? Give feedback.
-
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*/ |
Beta Was this translation helpful? Give feedback.
-
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.
Beta Was this translation helpful? Give feedback.
All reactions