<list>
: Remove an incorrect /* strengthened */
comment from the move assignment operator
#5020
Labels
documentation
Related to documentation or comments
fixed
Something works now, yay!
good first issue
Good for newcomers
Recently, when investigating stuffs in the standard library affected by WG21-N4258, I found that this exception specification isn't really strengthened:
STL/stl/inc/list
Lines 923 to 924 in 926d458
The standard requirement (in [list.overview]/2) is saying
noexcept(allocator_traits<Allocator>::is_always_equal::value)
, which hasn't changed since the adoption of N4258.Looking at the definition of
_Choose_pocma_v
, it can be inferred that_Choose_pocma_v<_Alnode> == _Pocma_values::_Equal_allocators
andallocator_traits<_Alnode>::is_always_equal::value
are actually equal.STL/stl/inc/xmemory
Lines 735 to 746 in 926d458
It's not very clear whether we're allowed use this value, see LWG-3267. But it is clear that this is not strengthening!
I believe we should remove the misleading
/* strengthened */
comment.Moreover, the exception specification of the move assignment operators of
deque
and (unordered) associative containers are spelt differently and more close to the forms specified in the standard. So perhaps we should spell the one oflist
asnoexcept(_Alnode_traits::is_always_equal::value)
.There's another
_Choose_pocma_v<_Alnode> == _Pocma_values::_Equal_allocators
in<xtree>
. I guess it would be more consistent to write_Alnode_traits::is_always_equal::value
instead.STL/stl/inc/xtree
Lines 943 to 944 in 926d458
This issue is intended for a new contributor (especially one new to GitHub) to get started with the simplest possible change.
Please feel free to submit a pull request if there isn't one already linked here - no need to ask for permission! 😸
You can (and should) link your pull request to this issue using GitHub's close/fix/resolve syntax.
(in the PR description not the commit message)
The text was updated successfully, but these errors were encountered: