1

I want to pass agregate initializer as function argument. But c++03 doesnt allow to do this.

What does the standard C++03 say about type conversion of agregate initializer? Is it correct?

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
}

0 Answers0