When is ADL applied?
问题 There are 3 examples: I. typedef int foo; namespace B { struct S { operator int(){ return 24; } }; int foo(B::S s){ return 0; } } int main() { int t=foo(B::S()); //24, ADL does not apply } II. namespace B { struct S { operator int(){ return 24; } }; int foo(B::S s){ return 0; } } int main() { int t=foo(B::S()); //0, ADL applies } III. namespace B { struct S { operator int(){ return 24; } }; int foo(B::S s){ return 0; } } int foo(B::S s){ return 12; } int main() { int t=foo(B::S()); //error: