VS2013RC允许使用大括号调用函数

VS 2013 RC allows to call functions using curly braces

本文关键字:调用 函数 许使用 VS2013RC      更新时间:2023-10-16

令我惊讶的是,VS 2013在编译时没有出现错误:

#include <utility>
int main() {
    auto p = std::make_pair{123, 12.3f};
    return 0;
}

这是什么新功能吗?可能是个bug。。。

编辑:VS 2013 RC现在也允许以这种方式调用成员函数。

该功能是即将推出的C++14标准的一部分。。http://en.wikipedia.org/wiki/C%2B%2B14#Function_return_type_deduction