Boost logo

Geometry :

Subject: Re: [geometry] for_each_point( ) and lambdas
From: Barend Gehrels (barend_at_[hidden])
Date: 2012-11-18 15:56:27

Hi Vladimir,

On 6-11-2012 17:34, Vladimir Petrovic wrote:
> The code tries to assign to functor: f = Policy::apply(*it, f);
> It seems correct to me that VC doesn't allow operator= for lambdas. On
> the other hand, it's natural to use lambda with for_each_point( ). Is
> there any other way to use for_each_point() or something similar with
> funktor which doesn't have operator= (like lambda) ?

This issue is fixed now (in the trunk). It will be released within Boost

The std::for_each returns the functor, and we do (still) the same. But
in the implementation behind, it is passed by reference, which is now
also done in Boost.Geometry. There is then no assignment. That makes it
functional for class-functor, function, and lambda. I also added a unit
test for lambda's.

Thanks again for the report.

Geometry list run by mateusz at