我想将agregate初始化程序作为函数参数传递。但是c ++ 03不允许这样做。
标准C ++ 03对agregate初始化程序的类型转换有何看法?这是对的吗?
struct A
{
int a, b;
};
void f(const A&){}
int main()
{
f({1, 2}); // c++03 doesnt allow this
f((A){1, 2}); // but c-style cast allows
//convert agregate initializer
}