<ranges>
: Drop one superfluous _Fake_copy_init<bool>
where the argument type is always bool
#4394
Labels
<ranges>
: Drop one superfluous _Fake_copy_init<bool>
where the argument type is always bool
#4394
Discovered while dealing with #4389.
The use of
_Fake_copy_init
here (determining whether the implicit coversion is non-throwing) looks superfluous.STL/stl/inc/ranges
Lines 3911 to 3912 in bd3d740
In this place:
_Left._Outer
and_Right._Outer
modelsforward_iterator
(definition can be found here), and thusdecltype(_Left._Outer == _Right._Outer)
should already modelboolean-testable
, and_Left._Inner
and_Right._Inner
are_Defaultabox
es (definition can be found here) for whichoperator==
always returnsbool
([1], [2]).As indicated by the use of
boolean-testable
, the&&
operator in_Left._Outer == _Right._Outer && _Left._Inner == _Right._Inner
should always has the built-in meaning and thus the result should always be abool
prvalue. Otherwise, the program is already ill-formed, possibly no diagnostic required.So, I think we can directly use
noexcept(_Left._Outer == _Right._Outer && _Left._Inner == _Right._Inner)
instead, which possibly slightly improves compiler throughput.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: