dimanche 25 décembre 2016

What if [member initializer lists] conflicts with [non-static data member with initializer] in C++11?

#include <iostream>

struct A
{
    A() : i(2){}
    int i = 1;
};

int main()
{
    std::cout << A().i;
}

1 or 2?

Which output is conforming to the C++11 standard?

Aucun commentaire:

Enregistrer un commentaire