Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost.Array intialisation
From: gast128 (gast128_at_[hidden])
Date: 2010-03-10 15:20:54


> #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.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net