[example] Fix call to pythagoras strategy.

This commit is contained in:
Vissarion Fisikopoulos 2022-12-19 16:29:03 +02:00
parent 1451c6ca65
commit 14e242b9d4

View File

@ -1,6 +1,9 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// Copyright (c) 2022 Oracle and/or its affiliates.
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@ -23,14 +26,14 @@ int main()
point_xy p2(5.0, 0.0);
// 1) This is direct call to Pythagoras algo
typedef strategy::distance::pythagoras<point_xy, point_xy, double> strategy1_type;
using strategy1_type = strategy::distance::pythagoras<double>;
strategy1_type strategy1;
strategy1_type ::calculation_type d1 = strategy1.apply(p1, p2);
auto d1 = strategy1.apply(p1, p2);
// 2) This is what is effectively called by simplify
typedef strategy::distance::comparable::pythagoras<point_xy, point_xy, double> strategy2_type;
using strategy2_type = strategy::distance::comparable::pythagoras<double>;
strategy2_type strategy2;
strategy2_type::calculation_type d2 = strategy2.apply(p1, p2);
auto d2 = strategy2.apply(p1, p2);
return 0;
}