|
Boost Users : |
Subject: Re: [Boost-users] [fusion] more trouble with transform
From: Ovanes Markarian (om_boost_at_[hidden])
Date: 2011-11-12 06:40:24
On Sat, Nov 12, 2011 at 12:20 PM, Ovanes Markarian
<om_boost_at_[hidden]>wrote:
> Hi!
>
> please see my answer below.
>
> On Sat, Nov 12, 2011 at 12:03 PM, Gennadiy Rozental <rogeeff_at_[hidden]>wrote:
>
>> Hi,
>>
>> Now I am trying to perform transform which mutates:
>>
>>
>> int
>> main()
>> {
>> B b1, b2;
>> auto z1 = fusion::make_list( b1, b2 ); !!! create a list of copied Bs
>>
>> auto z2 = fusion::as_list( fusion::transform( z1, make_c() ) ); !!!
>> copies Bs again
>
>
Actually transformation does not copy Bs. They are only copied at list
construction , but transform calls the function:
inline typename result_of::as_list<Sequence const>::type
as_list(Sequence const& seq)
{
return result_of::as_list<Sequence const>::call(seq);
}
Which deals with a const sequence...
Regards,
Ovanes
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