Replies: 1 comment
-
数组类型隐式转换为指针的优先级比常规隐式转换的高的多: #include <iostream>
auto f(const auto&){
puts("1");
}
auto f(const int&){
puts("2");
}
int main(){
double a{};
f(a);
} 这段代码必然输出 数组的事没什么办法。 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
给出代码
除了代码中给出的
func<>(str);
外,还有没有其他方法可以调用到模板函数?Beta Was this translation helpful? Give feedback.
All reactions