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 // <tuple>
11 
12 // template <class... Types> class tuple;
13 
14 // template <class... Types, class Alloc>
15 //   struct uses_allocator<tuple<Types...>, Alloc> : true_type { };
16 
17 // UNSUPPORTED: c++98, c++03
18 
19 #include <tuple>
20 #include <type_traits>
21 
22 struct A {};
23 
main()24 int main()
25 {
26     {
27         typedef std::tuple<> T;
28         static_assert((std::is_base_of<std::true_type,
29                                        std::uses_allocator<T, A>>::value), "");
30     }
31     {
32         typedef std::tuple<int> T;
33         static_assert((std::is_base_of<std::true_type,
34                                        std::uses_allocator<T, A>>::value), "");
35     }
36     {
37         typedef std::tuple<char, int> T;
38         static_assert((std::is_base_of<std::true_type,
39                                        std::uses_allocator<T, A>>::value), "");
40     }
41     {
42         typedef std::tuple<double&, char, int> T;
43         static_assert((std::is_base_of<std::true_type,
44                                        std::uses_allocator<T, A>>::value), "");
45     }
46 }
47