Implement LWG-3778 vector<bool> missing exception specifications#3332
Merged
StephanTLavavej merged 5 commits intomicrosoft:mainfrom Jan 12, 2023
Merged
Implement LWG-3778 vector<bool> missing exception specifications#3332StephanTLavavej merged 5 commits intomicrosoft:mainfrom
vector<bool> missing exception specifications#3332StephanTLavavej merged 5 commits intomicrosoft:mainfrom
Conversation
CaseyCarter
reviewed
Jan 9, 2023
| _Choose_pocma_v<_Alvbase> != _Pocma_values::_No_propagate_allocators) { | ||
| if (this == _STD addressof(_Right)) { | ||
| return *this; | ||
| } |
Contributor
There was a problem hiding this comment.
For other reviewers: vector<bool>::swap is already unconditionally noexcept with a strengthened comment in our implementation. We were previously strengthening from nothing to unconditional, after LWG-3778 we're strengthening from conditional to unconditional because we still aren't interested in throwing on precondition violation. (No change requested.)
CaseyCarter
approved these changes
Jan 9, 2023
StephanTLavavej
approved these changes
Jan 11, 2023
Member
|
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Member
|
Thanks for implementing this LWG issue resolution in everyone's favorite partial specialization! 😻 👻 ✅ |
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.
Fixes #3226.
Notes:
vector<bool, _Alloc>need to default-construct an_Allocinstead of_Alvbasein order to implement the required exception specification. I think this is not related to allocator propagation and thus possibly not covered by LWG-3267.P1004R2_constexpr_vector_booldue to this. Not sure whether such change is right now..._Vb_valfrom an allocator is alwaysnoexcept, so I changed the superfluous conditionalnoexceptto unconditional one.vector<bool, _Alloc>from(vector&&, const _Identity_t<_Alloc>&)is notnoexceptin the current working draft, so I added// strengthened.vector<bool, _Alloc>detect the properties of_Alvbase, which is consistent with other containers that need allocator rebinding.vector<bool>missing exception specifications #3226 (comment)), which would be able to resolve the divergence between standard requirements and actual implementations._Vb_valis not even move-assignable - the explicitly declared move constructor make the move assignment operator not declared, and the copy assignment operator implicitly deleted.