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