Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if find_last can find anything #4561

Merged
merged 12 commits into from
Apr 9, 2024
7 changes: 6 additions & 1 deletion stl/inc/algorithm
Original file line number Diff line number Diff line change
Expand Up @@ -2972,7 +2972,12 @@ namespace ranges {
if constexpr (is_same_v<_Pj, identity> && _Vector_alg_in_find_is_safe<_It, _Ty>
&& sized_sentinel_for<_Se, _It>) {
if (!_STD is_constant_evaluated()) {
const auto _Count = _Last - _First;
const auto _Count = _Last - _First;

if (!_STD _Could_compare_equal_to_value_type<_It>(_Value)) {
return {_First + _Count, _First + _Count};
}

const auto _First_ptr = _STD _To_address(_First);
const auto _Last_ptr = _First_ptr + _Count;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_matrix.lst
RUNALL_CROSSLIST
* PM_CL=""
* PM_CL="/D_USE_STD_VECTOR_ALGORITHMS=0"
Loading