Skip to content

Non-const size and reserve_hint#69

Merged
patrickroberts merged 1 commit intomainfrom
non-const-approximately-sized
May 5, 2026
Merged

Non-const size and reserve_hint#69
patrickroberts merged 1 commit intomainfrom
non-const-approximately-sized

Conversation

@patrickroberts
Copy link
Copy Markdown
Collaborator

This makes size() and reserve_hint() member functions non-const in order to erase views like drop_while_view<V> where V is a random_access_range. Because it caches the begin iterator, and the size computation is based on the difference between the sentinel and the cached iterator, the size() member is non-const, the size() member of any_view must also be non-const to erase it.

@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 81.008%. remained the same — non-const-approximately-sized into main

@patrickroberts patrickroberts merged commit 97c7971 into main May 5, 2026
77 checks passed
@patrickroberts patrickroberts deleted the non-const-approximately-sized branch May 5, 2026 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants