3 ms·
Isn't the real problem with initializer lists? It would be much nicer if C++ would allow me to call the field's constructors inside of the class' constructor, a
by captainmuon 13y ago
Isn't the real problem with initializer lists? It would be much nicer if C++ would allow me to call the field's constructors inside of the class' constructor, a la:
A::A() {
B::B();
try {
foo(1);
}
catch (...) {}
// you could even
if (something)
bar(2)
else
bar(3);
// or maybe with a different syntax,
// but without copying if this is an object
bar = 3
}
- zwieback 13y agoI'd love that too.