0
struct type{};
template<typename T>
void foo(T in) { bar(in, type()); }
void bar(int, const type&) {}
int main() { foo(42); }
这并不(正如我在previous question from today教训):
template<typename T>
void foo(T in) { bar(in); }
void bar(int) {}
int main() { foo(42); }
是第一个片段也编译的原因与ADL解释?如果是这样,怎么样?
模板参数是基本类型,ADL不应该为它工作...为什么使用类型type
有什么区别?