]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/std/containers/sequences/deque/deque.cons/default.pass.cpp
Vendor import of libc++ trunk r290819:
[FreeBSD/FreeBSD.git] / test / std / containers / sequences / deque / deque.cons / default.pass.cpp
1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 // <deque>
11
12 // deque()
13
14 #include <deque>
15 #include <cassert>
16
17 #include "test_allocator.h"
18 #include "../../../NotConstructible.h"
19 #include "min_allocator.h"
20
21 template <class T, class Allocator>
22 void
23 test()
24 {
25     std::deque<T, Allocator> d;
26     assert(d.size() == 0);
27 #if TEST_STD_VER >= 11
28     std::deque<T, Allocator> d1 = {};
29     assert(d1.size() == 0);
30 #endif
31 }
32
33 int main()
34 {
35     test<int, std::allocator<int> >();
36     test<NotConstructible, limited_allocator<NotConstructible, 1> >();
37 #if TEST_STD_VER >= 11
38     test<int, min_allocator<int> >();
39     test<NotConstructible, min_allocator<NotConstructible> >();
40 #endif
41 }