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