Boost logo

Geometry :

Subject: Re: [geometry] for_each_point( ) and lambdas
From: Barend Gehrels (barend_at_[hidden])
Date: 2012-11-17 11:39:28


Hi Vladimir,

Sorry for the delayed answer.

I can reproduce your problem. I adapted the for_each_point sample to use
a lambda, and applied it to a multipolygon, and it runs fine (as long as
I don't capture things). As soon as I capture something I get the same
error as you have.

On 6-11-2012 17:34, Vladimir Petrovic wrote:
> Hi,
> I'm trying to use the following code (boost 1.51.0) under Microsoft VC
> 11:
>
> boost::geometry::for_each_point( *this, [size](_TPoint<T>& pt) { pt +=
> size; } );

> The code tries to assign to functor: f = Policy::apply(*it, f);
As far as I know this is (or was) common practice, but indeed I get also
the error here. If I remove the assignment here (and in 2 similar
places) it runs fine with and without captured variables, but I have to
check the consequences.

Thanks for your report.

Regards, Barend


Geometry list run by mateusz at loskot.net