Tag: list-initialization
In C++11 Liste-Initialisierung bezieht sich auf das initialisieren von Variablen mit geschweiften Klammern
1
Antworten
Wenn ich diesen code ausführen: struct X { int a; }; struct Y : public X {}; X x = {0}; Y Y = {0}; Bekomme ich: error: could not convert ‘{0}’ from ‘<brace-enclosed initializer list>’ to
3
Antworten
MyClass a1 {a}; //clearer and less error-prone than the other three MyClass a2 = {a}; MyClass a3 = a; MyClass a4(a); Warum? Konnte ich nicht finden, eine Antwort auf SO, lassen Sie mich Antwort auf meine eigene
3
Antworten
MyClass a1 {a}; //clearer and less error-prone than the other three MyClass a2 = {a}; MyClass a3 = a; MyClass a4(a); Warum? Konnte ich nicht finden, eine Antwort auf SO, lassen Sie mich Antwort auf meine eigene