1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
12 // std::find with vector<bool>::iterator
14 // https://llvm.org/PR16816
21 #include "test_macros.h"
23 TEST_CONSTEXPR_CXX20
bool tests()
26 for (unsigned i
= 1; i
< 256; ++i
)
28 std::vector
<bool> b(i
,true);
29 std::vector
<bool>::iterator j
= std::find(b
.begin()+1, b
.end(), false);
30 assert(static_cast<std::size_t>(j
-b
.begin()) == i
);
35 for (unsigned i
= 1; i
< 256; ++i
)
37 std::vector
<bool> b(i
,false);
38 std::vector
<bool>::iterator j
= std::find(b
.begin()+1, b
.end(), true);
39 assert(static_cast<std::size_t>(j
-b
.begin()) == i
);
51 static_assert(tests());