samedi 9 septembre 2017

why default initialization using parentheses is not permissible in c++?

This is the example from Effective modern c++.

class Widget {
…
private:
int x{ 0 }; // fine, x's default value is 0
int y = 0; // also fine
int z(0); // error!

};

Aucun commentaire:

Enregistrer un commentaire