Boost logo

Boost Users :

Subject: Re: [Boost-users] [fusion] more trouble with transform
From: Joel de Guzman (joel_at_[hidden])
Date: 2011-11-13 07:59:57


On 11/12/2011 7:18 PM, Christopher Schmidt wrote:
> Gennadiy Rozental<rogeeff_at_[hidden]> writes:
>
>> Hi,
>>
>> Now I am trying to perform transform which mutates:
>>
[snip]
>>
>> Both gcc and msvc complain like this:
>>
>> test.cpp:29:46: error: passing ‘const B’ as ‘this’ argument of ‘C B::make_c()’
>> discards qualifiers.
>>
>> What am I missing now?
>>
>> Gennadiy
>
> fusion::transform only accepts cref-qualified sequences. That is why
> the resulting transform view will be store a reference to z1 const and
> thus the arguments passed to make_c are const-qualified.
>
> https://svn.boost.org/trac/boost/ticket/3446
>
> Construct the transform view by hand and your example should work fine.

Again, as I said in the link you gave, I am willing to accept a patch
if it includes docs + tests. The changes are simple enough. Just don't
give me a whole change-everything-in-one-fell-swoop patch. I will not
have enough time to review them all. Incremental changes such as this
will be good.

Regards,

-- 
Joel de Guzman
http://www.boostpro.com
http://boost-spirit.com

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