[TTI] getTypeBasedIntrinsicInstrCost - add basic handling for strided load/store...
[llvm-project.git] / libcxx / test / std / containers / container.adaptors / stack / stack.cons / ctor_default.pass.cpp
blob4d5aa88e4578ad304995050487ae0f58e6fc68ee
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 // <stack>
11 // explicit stack(Container&& = Container()); // before C++20
12 // stack() : stack(Container()) {} // C++20
13 // explicit stack(Container&&); // before C++20
15 #include <stack>
16 #include <vector>
17 #include <cassert>
19 #include "test_macros.h"
20 #include "test_allocator.h"
21 #if TEST_STD_VER >= 11
22 #include "test_convertible.h"
23 #endif
25 int main(int, char**)
27 typedef std::vector<int, limited_allocator<int, 10> > Container;
28 typedef std::stack<int, Container> Q;
29 Q q;
30 assert(q.size() == 0);
31 q.push(1);
32 q.push(2);
33 assert(q.size() == 2);
34 assert(q.top() == 2);
36 #if TEST_STD_VER >= 11
37 // It should be explicit, so not convertible before C++20.
38 static_assert(test_convertible<Q>(), "");
39 #endif
41 return 0;