
10 Mar
2010
10 Mar
'10
1:20 p.m.
#include <boost/assign/list_of.hpp> #include <boost/array.hpp>
using namespace boost::assign;
struct Foo { Foo() : m_a(list_of(1)(2)(3)(4)) {}
boost::array<int, 4> m_a; };
Roman Perepelitsa.
Jeff
Thx this works. I was more hoping for a solution without a helper function (e.g. m_a({1, 2}), but that doesn't compile), but probably it doesn't exist. Got btw also a C4701 warning by uisng this construct. Haven't delved into it to see if it is a dangerous one.