Boost logo

Boost Users :

Subject: Re: [Boost-users] [fusion] maps and arrays
From: Agustín K-ballo Bergé (kaballo86_at_[hidden])
Date: 2014-06-28 13:37:54


On 28/06/2014 12:19 a.m., Seeger, Steven D. (GSFC-444.0)[Embedded Flight
Systems, Inc] wrote:
> I've had some code written with boost 1.53 a while ago that uses fusion
> maps to define at compile-time packet structures. There is then compile
> time generated code that handles marshaling, unmarshaling, and packet
> size calculation on these structures. One of the big reasons for going
> this route was the ability to have arrays contained in the packets. When
> upgrading from boost 1.53 to 1.55 on my Gentoo box, this all broke.
>
> I'm contacting the list to ask if the use of arrays in containers was
> just a fluke or if it should be working and something happened in 1.55
> (or possibly 1.54 which I never tried.)

Not an official answer in any way, but considering it's not explicitly
documented as supported and your test case also fails when replacing
`fusion::map` with `std::tuple` I would consider it just a fluke in the
past. On the other hand, the following code compiles correctly (albeit
with possibly a warning):

     typedef std::tuple<short,
                        int,
                        std::array<int, 2>, // note std::array
                        std::string > test_t;

     test_t test{1, 2, {}, {"hello"}};

The same is not true for a `fusion::map`, and I think supporting that
case would be worth it.

Regards,

-- 
Agustín K-ballo Bergé.-
http://talesofcpp.fusionfenix.com

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