Skip to content

Commit d9be996

Browse files
committed
Implement mnatsuhara comment
1 parent f64509e commit d9be996

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

stl/inc/vector

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2917,21 +2917,20 @@ _CONSTEXPR20 void _Fill_vbool(_FwdIt _First, _FwdIt _Last, const _Ty& _Val) {
29172917
*_UFirst = (*_UFirst & _FirstDestMask) | (_FillVal & _FirstSourceMask);
29182918
++_UFirst;
29192919

2920-
if (true
29212920
#ifdef __cpp_lib_is_constant_evaluated
2922-
&& !_STD is_constant_evaluated()
2921+
if (_STD is_constant_evaluated()) {
2922+
for (; _UFirst != _ULast; ++_UFirst) {
2923+
*_UFirst = _FillVal;
2924+
}
2925+
} else
29232926
#endif // __cpp_lib_is_constant_evaluated
2924-
) {
2927+
{
29252928
const auto _UFirst_ch = reinterpret_cast<const char*>(_UFirst);
29262929
const auto _ULast_ch = reinterpret_cast<const char*>(_ULast);
29272930
const auto _Count_ch = static_cast<size_t>(_ULast_ch - _UFirst_ch);
29282931
const auto _ValChar = static_cast<unsigned char>(_Val ? -1 : 0);
29292932
_CSTD memset(_UFirst, _ValChar, _Count_ch);
29302933
_UFirst += _ULast - _UFirst;
2931-
} else {
2932-
for (; _UFirst != _ULast; ++_UFirst) {
2933-
*_UFirst = _FillVal;
2934-
}
29352934
}
29362935

29372936
if (_Last._Myoff != 0) {

0 commit comments

Comments
 (0)