compiler error side_by_triangle boost_1_61_0

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

compiler error side_by_triangle boost_1_61_0

Egon_Schaal_CADCONS_DE

Hello

I have a small example with brings compiler error

E:\boost\boost_1_61_0\boost\geometry\strategies\cartesian\side_by_triangle.hpp:239: Fehler: no match for 'operator>' (operand types are 'promoted_type {aka boost::geometry::model::point<double, 2u, boost::geometry::cs::cartesian>}' and 'const promoted_type {aka const boost::geometry::model::point<double, 2u, boost::geometry::cs::cartesian>}')

             : s > zero ? 1

                 ^

Compiler is mingw53.0 and msvc 2015

 

#include <iostream>

 

#include <boost/geometry/strategies/cartesian/side_by_triangle.hpp>

#include <boost/geometry.hpp>

 

using namespace std;

 

int main(int argc, char *argv[])

{

  namespace bg = boost::geometry;

 

  typedef bg::model::point<double, 2, bg::cs::cartesian> point_t;

  point_t _p1(100.0, 100.0);

  point_t _p3(100.0, -100.0);

 

  point_t _pt(120.0, 50.0);

 

  int s = bg::strategy::side::side_by_triangle<point_t>::apply(_p1, _p3, _pt);

 

  std::cout << s;

 

  return 0;

}

 

 

Mit freundlichen Grüßen / Best regards

Egon Schaal

 

/////////////////////////////////////

Cad-Consulting, Softwareerstellung

Aspacherstr 15

D-71522 Backnang

[hidden email]

http://www.cad-cons.com

Tel. +49(0)7191-84498

Fax +49(0)7191-71410

Mobil +49(0)1713883254

/////////////////////////////////////

 


_______________________________________________
Geometry mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/geometry
Reply | Threaded
Open this post in threaded view
|

Re: compiler error side_by_triangle boost_1_61_0

Adam Wulkiewicz
Hi Egon,

Egon Schaal_cadcons_de wrote:

Hello

I have a small example with brings compiler error

E:\boost\boost_1_61_0\boost\geometry\strategies\cartesian\side_by_triangle.hpp:239: Fehler: no match for 'operator>' (operand types are 'promoted_type {aka boost::geometry::model::point<double, 2u, boost::geometry::cs::cartesian>}' and 'const promoted_type {aka const boost::geometry::model::point<double, 2u, boost::geometry::cs::cartesian>}')

             : s > zero ? 1

                 ^

Compiler is mingw53.0 and msvc 2015

 


It's because this strategy takes CalculationType as template parameter, not PointType.
By default the CalculationType is deduced from coordinate types of passed Points.
So you should modify your code like this:

bg::strategy::side::side_by_triangle<>::apply(_p1, _p3, _pt);

Regards,
Adam

_______________________________________________
Geometry mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/geometry
Reply | Threaded
Open this post in threaded view
|

Re: compiler error side_by_triangle boost_1_61_0

Egon_Schaal_CADCONS_DE

Hi Adam,

Thanks. That works.

 

Mit freundlichen Grüßen / Best regards

Egon Schaal

 

/////////////////////////////////////

Cad-Consulting, Softwareerstellung

Aspacherstr 15

D-71522 Backnang

[hidden email]

http://www.cad-cons.com

Tel. +49(0)7191-84498

Fax +49(0)7191-71410

Mobil +49(0)1713883254

/////////////////////////////////////

 

Von: Geometry [mailto:[hidden email]] Im Auftrag von Adam Wulkiewicz
Gesendet: Mittwoch, 3. August 2016 16:43
An: Boost.Geometry library mailing list
Betreff: Re: [geometry] compiler error side_by_triangle boost_1_61_0

 

Hi Egon,

Egon Schaal_cadcons_de wrote:

Hello

I have a small example with brings compiler error

E:\boost\boost_1_61_0\boost\geometry\strategies\cartesian\side_by_triangle.hpp:239: Fehler: no match for 'operator>' (operand types are 'promoted_type {aka boost::geometry::model::point<double, 2u, boost::geometry::cs::cartesian>}' and 'const promoted_type {aka const boost::geometry::model::point<double, 2u, boost::geometry::cs::cartesian>}')

             : s > zero ? 1

                 ^

Compiler is mingw53.0 and msvc 2015

 


It's because this strategy takes CalculationType as template parameter, not PointType.
By default the CalculationType is deduced from coordinate types of passed Points.
So you should modify your code like this:

bg::strategy::side::side_by_triangle<>::apply(_p1, _p3, _pt);

Regards,
Adam


_______________________________________________
Geometry mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/geometry