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 // <queue>
11 
12 // template <class Alloc>
13 //   explicit queue(const Alloc& a);
14 
15 #include <queue>
16 #include <cassert>
17 
18 #include "test_allocator.h"
19 
20 struct test
21     : private std::queue<int, std::deque<int, test_allocator<int> > >
22 {
23     typedef std::queue<int, std::deque<int, test_allocator<int> > > base;
24 
testtest25     explicit test(const test_allocator<int>& a) : base(a) {}
testtest26     test(const container_type& c, const test_allocator<int>& a) : base(c, a) {}
27 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
testtest28     test(container_type&& c, const test_allocator<int>& a) : base(std::move(c), a) {}
testtest29     test(test&& q, const test_allocator<int>& a) : base(std::move(q), a) {}
30 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
get_allocatortest31     test_allocator<int> get_allocator() {return c.get_allocator();}
32 };
33 
main()34 int main()
35 {
36     test q(test_allocator<int>(3));
37     assert(q.get_allocator() == test_allocator<int>(3));
38 }
39