經安全檢測,此網站為安全網站,請放心前往原始網址!

C++: constructor initializer for arrays - Stack Overflow

Right now, you can't use the initializer list for array members. You're stuck doing it the hard way. class Baz { Foo foo[3]; Baz() { foo[0] = Foo(4); foo[1] = Foo(5); foo[2] = Foo(6); } }; In C++0x you can write: class Baz { Foo foo[3]; Baz() : foo ...

stackoverflow.com

網址安全性掃描由 google 提供