|
Boost Users : |
Subject: Re: [Boost-users] fusion quesion
From: Joel de Guzman (joel_at_[hidden])
Date: 2011-11-24 00:40:21
On 11/24/2011 1:07 PM, Robert Ramey wrote:
> Fusion includes a number of binary functions such as join, equal, less, etc.
>
> Looking at the code suggests that they just work element by element in
> sequential order.
>
> But what about associative tuples? For example
>
> struct account {};
> struce amount {};
>
> typedef boost::fusion::set<
> account,
> amount
>> debit;
>
> typedef boost::fusion::set<
> amount,
> account
>> debit2.
>
> clearly the types are meant to be the "same" so I would expect
>
> boost::fusion::join(debit, debit2) to function and return one type.
> I'm thinking it doesn't do that. Any observations/suggestions that any
> Fusion
> guru would like to share would be appreciated.
Join simply creates a joint_view which concatenates debit and debit2:
joint_view<debit, debit2>
What you probably want are set operations such as set_union.
Unfortunately, we do not have those yet. Such set operations
should be cool to implement if anyone is interested in contributing.
Regards,
-- Joel de Guzman http://www.boostpro.com http://boost-spirit.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