基本上这是关于最令人头疼的解析的this question的后续。我可以理解这是由于函数声明和变量定义之间的不明确性。 但在Comeau在线,我只是厌倦了以下。 class T{
public:
T(int i){
}
int fun1(){
return 1;
}
};
int main()
{
T myT(10);
可能重复: Why is it an error to use an empty set of brackets to call a constructor with no arguments? 让我们有这样的代码 class Foo {
Foo(int) { }
};
那么我们有没有结果: int main() {
Foo f1 = Foo(5); // 1: OK,
在构造函数的定义print语句不打印它的typeid的,没有构造函数调用正确的主?我知道我在这里错过了一些观点,请指出。 #include <iostream>
#include <typeinfo>
template <typename T> class List
{
public:
template <typename T2> List (List<T2> con