Skip to content

Conversation

@agl-alexglopez
Copy link
Collaborator

Using the with capacity initializer with a 0 capacity argument is well defined. Even though the underlying reserve function returns an argument error, since the container is returned by the initializer all container state remains valid.

@agl-alexglopez agl-alexglopez marked this pull request as ready for review January 4, 2026 17:03
@agl-alexglopez agl-alexglopez merged commit 73f7c03 into main Jan 4, 2026
7 checks passed
@agl-alexglopez agl-alexglopez deleted the with-capacity-zero branch January 4, 2026 17:04
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