Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce assign_range() mandates for sequence containers #5086

Merged

Conversation

muellerj2
Copy link
Contributor

Resolves #5076 by statically asserting the mandates for the sequence containers deque, forward_list, list, and vector.

basic_string also defines a function assign_range(), but I did not add a static assert to it: basic_string includes its own specification of assign_range() which does not provide for any Mandates ([string.assign]/16). Besides, the standard doesn't list basic_string among the sequence containers in [sequence.reqmts]/1, so it appears to me that [sequence.reqmts]/60 doesn't apply directly to basic_string.

@muellerj2 muellerj2 requested a review from a team as a code owner November 14, 2024 21:03
@CaseyCarter CaseyCarter self-assigned this Nov 14, 2024
@CaseyCarter CaseyCarter added bug Something isn't working ranges C++20/23 ranges labels Nov 14, 2024
stl/inc/deque Outdated Show resolved Hide resolved
stl/inc/vector Outdated Show resolved Hide resolved
@CaseyCarter CaseyCarter removed their assignment Nov 14, 2024
@StephanTLavavej StephanTLavavej self-assigned this Nov 19, 2024
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit 64d143d into microsoft:main Nov 19, 2024
39 checks passed
@StephanTLavavej
Copy link
Member

Thanks for fixing this bug and increasing the STL's conformance! 📈 🐞 🛠️

@muellerj2 muellerj2 deleted the enforce-assign_range-mandates branch November 23, 2024 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ranges C++20/23 ranges
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

<vector>: assign_range() is missing Mandates
3 participants