Boost logo

Geometry :

Subject: Re: [geometry] one-line bug in algorithms/distance.hpp
From: Barend Gehrels (barend_at_[hidden])
Date: 2013-11-01 10:55:12

Hi Menelaos,

Menelaos Karavelas wrote On 1-11-2013 14:11:
> Hello all.
> I tried to compile the attached simple program to compute the distance between a linestring and a point while passing a strategy. I am using boost 1.54.0.
> The compilation failed due to the last call to distance. The problem is that in line 401 of algorithms/distance.hpp, the compiler tries to define the pp_strategy_type via the typedef:
> typedef typename Strategy::point_strategy_type pp_strategy_type;
> (where Strategy is the projected_point strategy), but the type point_strategy_type is not defined in the projected_point class.
> The fix to this is easy. Replace the above line by:
> typedef typename strategy::distance::services::strategy_point_point<Strategy>::type pp_strategy_type.
> All the best,
> - m.
> P.S. One could define the missing type in the projected_point class, but I find the solution above more elegant...

Sure! Good catch. The point_strategy_type used to be there, but was
replaced but alas not at that point...

I added it plus a unit-test case which was apparently missing.

Thanks, Barend

Geometry list run by mateusz at