Boost logo

Boost Users :

Subject: Re: [Boost-users] lambda::var( i )++
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2011-03-09 18:35:37


AMDG

On 03/09/2011 03:26 PM, er wrote:
> Is there a variant of this
>
> int i = 0;
> lambda::var( i )++;
>
> in which I can do away with the external variable, i? In other words,
> a nullary functor that returns 0, 1, 2, successively?

No. Remember that function objects are copyable.
The state needs to be stored separately to avoid
problems.

In Christ,
Steven Watanabe


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