Boost logo

Boost :

Subject: Re: [boost] [GSoC][Phoenix3] Regarding mutability of arguments passed to phoenix expressions
From: Eric Niebler (eric_at_[hidden])
Date: 2010-06-12 18:01:13


On 6/12/2010 5:34 PM, Mathias Gaunard wrote:
>
> For captures, I don't see how anyone would want to do anything but
> capture everything by reference.
>

function<int(int)> plus_i( int i )
{
   return _1 + i;
}

If you capture i by reference, this code will compile but crash at
runtime. Have fun debugging it! :-)

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com

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