[lld][WebAssembly] Introduce Ctx::arg
[llvm-project.git] / libcxx / test / std / containers / sequences / deque / deque.modifiers / assign_range.pass.cpp
blob744e03a7b983e9e0355ef695992d1db532fb4212
1 //===----------------------------------------------------------------------===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
11 // template<container-compatible-range<T> R>
12 // constexpr void assign_range(R&& rg); // C++23
14 #include <deque>
16 #include "../../insert_range_sequence_containers.h"
17 #include "test_macros.h"
19 // Tested cases:
20 // - different kinds of assignments (assigning an {empty/one-element/mid-sized/long range} to an
21 // {empty/one-element/full} container);
22 // - assigning move-only elements;
23 // - an exception is thrown when copying the elements or when allocating new elements.
24 int main(int, char**) {
25 static_assert(test_constraints_assign_range<std::deque, int, double>());
27 for_all_iterators_and_allocators<int, const int*>([]<class Iter, class Sent, class Alloc>() {
28 test_sequence_assign_range<std::deque<int, Alloc>, Iter, Sent>([]([[maybe_unused]] auto&& c) {
29 LIBCPP_ASSERT(c.__invariants());
30 });
31 });
32 test_sequence_assign_range_move_only<std::deque>();
34 test_assign_range_exception_safety_throwing_copy<std::deque>();
35 test_assign_range_exception_safety_throwing_allocator<std::deque, int>();
37 return 0;