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 // <deque>
10 
11 // explicit deque(const allocator_type& a);
12 
13 #include <deque>
14 #include <cassert>
15 
16 #include "test_allocator.h"
17 #include "../../../NotConstructible.h"
18 #include "min_allocator.h"
19 
20 template <class T, class Allocator>
21 void
22 test(const Allocator& a)
23 {
24     std::deque<T, Allocator> d(a);
25     assert(d.size() == 0);
26     assert(d.get_allocator() == a);
27 }
28 
29 int main(int, char**)
30 {
31     test<int>(std::allocator<int>());
32     test<NotConstructible>(test_allocator<NotConstructible>(3));
33 #if TEST_STD_VER >= 11
34     test<int>(min_allocator<int>());
35     test<NotConstructible>(min_allocator<NotConstructible>{});
36     test<int>(explicit_allocator<int>());
37     test<NotConstructible>(explicit_allocator<NotConstructible>{});
38 #endif
39 
40   return 0;
41 }
42