
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. Robert Ramey

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

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
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,

On 11/24/2011 2:15 PM, Robert Ramey wrote:
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.
Hi Robert, Sorry, I almost missed this. Right now, I do not have enough time, but you can probably add a feature request so I won't forget. I can try to find some time in the near future. Perhaps I can implement one set operation as a template for the other operations. I'm very interested in what you are working on. Regards, -- Joel de Guzman http://www.boostpro.com http://boost-spirit.com
participants (2)
-
Joel de Guzman
-
Robert Ramey