|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2006-08-31 11:20:11
Joel de Guzman <joel_at_[hidden]> writes:
> David Abrahams wrote:
>> Joel de Guzman <joel_at_[hidden]> writes:
>>
>>> Joel de Guzman wrote:
>>>> Hello,
>>>>
>>>> I shall be putting Fusion in the CVS (HEAD) soon. The old
>>>> Fusion(1) under the Spirit directory will cease to exist.
>>>> I shall try to adjust all boost libraries that rely on it
>>>> to use the new Fusion2 instead.
>>> Fusion2 is in CVS now. I adjusted tr1::tuple to use Fusion2
>>> instead.
>>
>> Totally cool!
>>
>> Did you write the necessary components to make boost::tuple and
>> boost::cons conforming fusion tuples?
>
> Not yet. There are still lots of work to do, but that's a high item
> in the todo list. One higher priority item is to make it easier to
> make conforming fusion sequences. It would be a good idea to do that
> first and leverage that for boost::cons. There's also an interesting
> use-case that became apparent recently: making arbitrary structs/classes
> conforming sequences easily-- as easy as providing a single function.
> Pardon me if this is rather sketchy at this point, but imagine
> being able to write:
>
> Our user defined struct:
>
> struct point { float x, float y; };
>
> Customization:
>
> fusion::map<keys::x_, keys::y_, float&, float&>
> as_fusion_sequence(point& p)
> {
> return fusion::map_tie<keys::x_, keys::y_>(p.x, p.y);
> }
>
> Use:
>
> point p = { 123.456, 789.012 };
> fusion::for_each(p, std::cout << _1 << std::endl);
That's nice, but I don't think it's really the same thing. Doesn't it
incur an extra level of indirection?
-- Dave Abrahams Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk