Skip to content

Geometry transform : inplace version? #1090

Answered by awulkiew
ghost asked this question in Q&A
Discussion options

You must be logged in to vote

I can think of two reasons why the interface looks like this:

  • it is based on STL and std::transform takes two ranges,
  • geometry::transform returns bool indicating whether or not transformation was successful. So theoretically it is possible that transform might fail and in this case a user could end up with a geometry that was partially modified. With that said AFAIK transformations that are supported by default never fail.

AFAIU to meet your expectations it would probably be enough to make sure that the algorithm works for the same geometry passed as input and output, correct?

For now:

bg::for_each_point(geometry, [](auto &pt) {
    auto tmp = pt;
    bg::transform(tmp, pt, per_point_st…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant
Converted from issue

This discussion was converted from issue #1077 on November 11, 2022 11:57.