brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · 7681eb6 Raw
44 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9// FIXME: This takes over an hour to compile, disable for now.10// UNSUPPORTED: LIBCXX-AMDGPU-FIXME11// UNSUPPORTED: LIBCXX-NVPTX-FIXME12 13// UNSUPPORTED: c++03, c++11, c++14, c++17, c++2014// UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME15 16// template<container-compatible-range<T> R>17//   constexpr iterator insert_range(const_iterator position, R&& rg); // C++2318 19#include <deque>20 21#include "../../insert_range_sequence_containers.h"22#include "test_macros.h"23 24// Tested cases:25// - different kinds of insertions (inserting an {empty/one-element/mid-sized/long range} into an26//   {empty/one-element/full} container at the {beginning/middle/end});27// - inserting move-only elements;28// - an exception is thrown when copying the elements or when allocating new elements.29int main(int, char**) {30  static_assert(test_constraints_insert_range<std::deque, int, double>());31 32  for_all_iterators_and_allocators<int, const int*>([]<class Iter, class Sent, class Alloc>() {33    test_sequence_insert_range<std::deque<int, Alloc>, Iter, Sent>([]([[maybe_unused]] auto&& c) {34      LIBCPP_ASSERT(c.__invariants());35    });36  });37  test_sequence_insert_range_move_only<std::deque>();38 39  test_insert_range_exception_safety_throwing_copy<std::deque>();40  test_insert_range_exception_safety_throwing_allocator<std::deque, int>();41 42  return 0;43}44