基本上这是这个关于最令人烦恼的解析的问题的后续。我可以理解这是由于函数声明和变量定义之间的歧义。
但是在Comeau online,我只是厌倦了以下。
class T{
public:
T(int i){
}
int fun1(){
return 1;
}
};
int main()
{
T myT(10); // I thought it'd be a function declaration that takes an int and returns a type T
myT.fun1(); // and a compiler error out here.
}
但它编译得很好,没有错误。我查看了标准文档,但无法得出一个推理。
那么,我在这里缺少什么?