
9 Aug
2006
9 Aug
'06
1:22 p.m.
Sylvain Pion <Sylvain.Pion <at> sophia.inria.fr> writes:
Jeff Flinn wrote:
Would not the boost.assign library work here?
class A { boost::array<int, 3> a; A() : a(boost::assign::list_of(1)(2)(3)(4)) {} };
I don't think I've tried it this way yet.
It works, but it's not efficient. It is even incredibly worse that doing the assignments by hand (boost 1.33.1 is better than 1.32 though). See my attached test program. Here is what I get (with g++ 4.1):
Try throwing this into the mix: a(boost::assign::cref_list_of<3>(1)(2)(3)) -Thorsten