
10 Mar
2010
10 Mar
'10
4:38 a.m.
Hello all, the documentation describes that Boost.Array deliberately omits constructors to allow intialisation in functions: void F() { boost::array<int, 4> a2 = { 1, 2, 3 }; } That's fine, but how does one intialise a Boost.Array in member intialiser list, e.g.: struct Foo { Foo() : m_a(???) { } boost::array<int, 4> m_a; }; Ofc initialisation can be done in the body of the constructor, but this does not work for const member variables. Also above design choice is contradictionary with STL containers, which gets default initialised. (e.g. m_v (3); ofc there is a difference, since vectors have a dynamic size). thx in advance