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 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
13 #include "../from_range_sequence_containers.h"
14 #include "test_macros.h"
16 // template<container-compatible-range<T> R>
17 // vector(from_range_t, R&& rg, const Allocator& = Allocator()); // C++23
19 constexpr bool test() {
20 for_all_iterators_and_allocators
<bool>([]<class Iter
, class Sent
, class Alloc
>() {
21 test_vector_bool
<Iter
, Sent
, Alloc
>([]([[maybe_unused
]] const auto& c
) {
22 LIBCPP_ASSERT(c
.__invariants());
23 // `is_contiguous_container_asan_correct` doesn't work on `vector<bool>`.
30 int main(int, char**) {
32 static_assert(test());
34 static_assert(test_constraints
<std::vector
, bool, char>());
36 // Note: test_exception_safety_throwing_copy doesn't apply because copying a boolean cannot throw.
37 test_exception_safety_throwing_allocator
<std::vector
, bool>();