dimanche 22 janvier 2017

why {} trigger Widget(0) instead of Widget(-1)?

class Widget {
public:
explicit Widget(int = -1);
...
};
std::array<Widget, 5> arr4; // construct all Widgets from -1
std::array<Widget, 5> arr5 {}; // construct all Widgets from 0

Question> Why arr5 is constructed with Widget(0)?

Thank you

Aucun commentaire:

Enregistrer un commentaire