开发者

C++ template overloading query [closed]

开发者 https://www.devze.com 2023-03-27 22:04 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. 开发者_开发问答 Closed 11 years ago.

I have seen an interesting question here: http://www.codeguru.com/forum/archive/index.php/t-466357.html

Here is the report:

template<class T, class C> void foo(T op1, C op2) {}; //line 1
template<class C, class T> void foo(C op1, T op2) {}; //line 2
template<class T, class C> void foo(C op1, T op2) {}; //line 3

Q> When the above code is compiled, which line will give an error, and why.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号