|
Boost Users : |
Subject: Re: [Boost-users] fusion quesion
From: Robert Ramey (ramey_at_[hidden])
Date: 2011-11-24 01:15:22
Joel de Guzman wrote:
> 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.
That's it exactly.
> Unfortunately, we do not have those yet. Such set operations
> should be cool to implement if anyone is interested in contributing.
I may well want to do this for what I'm working on. I'm not all that
confident that I can understand enough about the way fusion works
to actually do something useful, but if I do this I'll send it to you.
In the course of this experiment, I made some fusion concept classes
which I wouldn't mind sending for your perusal. However, when I
tried to make Archtype classes for a test program I sort of got
stuck. I couldn't really make something that looked correct but
wasn't tautological - that is that basically was based on the
concept code it was trying to verify.
Robert Ramey
>
> Regards,
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