<xutility>
, <algorithm>
: vector algorithms dispatching functions miss top level const
on pointer parameters
#4385
Labels
enhancement
Something can be improved
fixed
Something works now, yay!
good first issue
Good for newcomers
The affected code
STL/stl/inc/algorithm
Lines 66 to 112 in bd3d740
STL/stl/inc/xutility
Lines 113 to 214 in bd3d740
The desired change
The functions being defined here are taking
_Ty* _First, _Ty* _Last
parameters, but aren't modifying_First
and_Last
themselves. We should apply top-levelconst
to these pointers, changing them to_Ty* const _First, _Ty* const _Last
which will make our code more consistent and ever-so-slightly more resistant to mistakes.Note that
__std_find_trivial_unsized
takes only_Ty* _First
but should be changed similarly.About this "good first issue"
This issue is intended for a new contributor (especially one new to GitHub) to get started with a simple 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: