【发布时间】:2013-06-08 06:48:25
【问题描述】:
我正在学习 C++11,偶然发现了统一初始化程序。
我不明白以下代码应该显示“最令人烦恼的解析”歧义:
#include<iostream>
class Timer
{
public:
Timer() {}
};
int main()
{
auto dv = Timer(); // What is Timer() ? And what type is dv?
int time_keeper(Timer()); // This is a function right? And why isn't the argument " Timer (*) ()" ?
return 0;
}
【问题讨论】:
-
AFAIK 第二行调用 MVP,第一行没有。
-
我知道,但我对代码中涉及的类型感到困惑
标签: c++ class c++11 function-pointers