0

I'm working with the boost geometry library and i have read in the documentation that i should prefer using boost::geometry::set<0>(point1, 1.0); instead of point1.set<0>(1.0); Same with the get method: bg::get<0>(point1) instead of point1.get<0>();

Can anyone explain why i should do so? The documentation is here (Examples; on the bottom of the page): boost point documentation

Felix
  • 1,830
  • 12
  • 18

1 Answers1

0

Using boost::geometry::get<0>(point1) you support any point type. Also points having methods like point.x(). Using point1.get<0>() you support only some point types, like the point type provided by Boost.Geometry. However, if that is all you need, you can use that of course too.

Barend Gehrels
  • 967
  • 5
  • 8