Draft
Conversation
Author
|
I believe the reason the build failed for this before was the minimum required version of CMake ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a speculative/demonstrative PR to show how the
poly2triAPI could be potentially improved upon by accepting aspanofp2t::Pointinstead of astd::vector<p2t::Point*>.In this case, the
spanimplementation is taken from the Guidelines Support Library (GSL) from Microsoft, but it could also usestd::spanif poly2tri was updated to use C++ 20.In my particular use case, I needed to create a vector of
p2t::Pointtypes, and an additional 'view' vector ofp2t::Point*. By using aspan, the semantics of using a vector of pointers remains the same, but you don't need to allocate a new container of pointers, you can just use the original one. You also can avoid having toneweach point (as is done in thetestbedexample andunittestproject).I realize this is a breaking API change and it's possible there are some downsides I'm not considering, but for my particular use case, it made things a lot cleaner and simpler (and more efficient).
I'd definitely be interested to hear what people think.
Thanks!