boostorg / boostorg/polygon

Reduce capacity of polygon_{;45_;90_}set with shrink_to_fit functionality

Open
#25 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
70
Forks
75
PR merge metrics
No merged PRs in 30d

Description

First, I'd like to thank you for providing such an awesome library.

But I think the method shrink_to_fit() is missing in order to reduce the capacity of any set.

In your documentation, it is mentioned under the clear() command that one should

> Use shrink to fit idiom and assign default constructed polygon set to deallocate.

but there is no way of getting the vector to "shrink_to_fit()" because the value() function is declared as const.
So basically, one has no option to deallocate the memory of a huge polygon_set .

An easy fix would be to add a method as follows:

```
void shrink_to_fit(){
data_.shrink_to_fit();
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.