Boost logo

Boost :

Subject: Re: [boost] [Fusion] Some ideas
From: TONGARI (tongari95_at_[hidden])
Date: 2013-02-02 22:50:51


2013/2/3 Joel de Guzman <djowel_at_[hidden]>

> On 2/2/13 3:52 PM, TONGARI wrote:
>
>> Hi,
>>
>> Here are some ideas come up when writing some associative mapping
>> algorithm/views.
>> I think it'd be nice to have:
>> * Auxiliary function 'eval' to force the evaluation of transform-like view
>> e.g. fusion::eval(fusion::**transform(a, b, some_void_return_ftor))
>>
>
> How's that any different from as_vector, as_list, etc. ?

They cannot take voids.

> Also, what will be the container type of the result of "eval" ?

Void. Just to trigger each transformation.

> * Conversion function 'as_view' to make Container a view to reserve the
>> mutability.
>>
>
> You mean to make it immutable?

No, the opposite, to keep the elements mutable as they were.
Algorithms in Fusion take const&, 'as_view' is mean to workaround.
Not sure if Fusion will insist on functional-style.

What do you think? Are these already achieved in some way that I didn't
>
>> aware of?
>>
>> BTW, I just implemented left_mapping/left_mapped_view, it's used like
>>
>> result = left_mapping(m1, m2, transform);
>>
>> For elements not mapped, fusion::void_ is passed to transform.
>>
>> Still mapping & full_mapping to do...
>>
>
> Awesome! Looking forward to this.
>

It'll be soon. (but not for the docs :p)

Regards


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk