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 //===----------------------------------------------------------------------===//
13 // explicit stack(Container&&= Container()); // before C++20
14 // stack() : stack(Container()) {} // C++20
15 // explicit stack(Container&&); // C++20
20 #include "test_macros.h"
22 #if TEST_STD_VER >= 11
23 #include "test_convertible.h"
31 for (int i
= 0; i
< n
; ++i
)
32 c
.push_back(MoveOnly(i
));
38 typedef std::deque
<MoveOnly
> Container
;
39 typedef std::stack
<MoveOnly
> Q
;
40 Q
q(make
<Container
>(5));
41 assert(q
.size() == 5);
43 #if TEST_STD_VER >= 11
44 static_assert(!test_convertible
<Q
, Container
&&>(), "");