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//===----------------------------------------------------------------------===//
8
9// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
10// UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME
11
12// template<container-compatible-range<T> R>
13// void push_range(R&& rg); // C++23
14
15#include <stack>
16
17#include "../../push_range_container_adaptors.h"
18#include "test_macros.h"
19
20int main(int, char**) {
21 for_all_iterators_and_allocators<int, const int*>([]<class Iter, class Sent, class Alloc>() {
22 test_push_range<std::stack<int, std::deque<int, Alloc>>, Iter, Sent>();
23 });
24 test_push_range_move_only<std::stack>();
25 test_push_range_inserter_choice<std::stack, int>();
26
27 static_assert(test_constraints_push_range<std::stack, int, double>());
28
29 test_push_range_exception_safety_throwing_copy<std::stack>();
30 test_push_range_exception_safety_throwing_allocator<std::stack, std::deque, int>();
31
32 return 0;
33}
34

source code of libcxx/test/std/containers/container.adaptors/stack/stack.defn/push_range.pass.cpp