
10 Mar
2010
10 Mar
'10
5:36 a.m.
Or use boost assign as shown inline below. Though I'm not sure of the performance differences. Roman Perepelitsa wrote:
2010/3/10 gast128 <gast128@hotmail.com <mailto:gast128@hotmail.com>>
That's fine, but how does one intialise a Boost.Array in member intialiser list
boost::array<int, 4> MakeArray() { boost::array<int, 4> res = { 1, 2, 3, 4 }; return res; }
#include <boost/assign/list_of.hpp> #include <boost/array.hpp> using namespace boost::assign;
struct Foo { Foo() : m_a(MakeArray()) {}
Foo() : m_a(list_of(1)(2)(3)(4)) {}
boost::array<int, 4> m_a; };
Roman Perepelitsa.
Jeff