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++03
17
18 #include <tuple>
19 #include <type_traits>
20
21 #include "test_macros.h"
22
23 struct A {};
24
main(int,char **)25 int main(int, char**)
26 {
27 {
28 typedef std::tuple<> T;
29 static_assert((std::is_base_of<std::true_type,
30 std::uses_allocator<T, A>>::value), "");
31 }
32 {
33 typedef std::tuple<int> T;
34 static_assert((std::is_base_of<std::true_type,
35 std::uses_allocator<T, A>>::value), "");
36 }
37 {
38 typedef std::tuple<char, int> T;
39 static_assert((std::is_base_of<std::true_type,
40 std::uses_allocator<T, A>>::value), "");
41 }
42 {
43 typedef std::tuple<double&, char, int> T;
44 static_assert((std::is_base_of<std::true_type,
45 std::uses_allocator<T, A>>::value), "");
46 }
47
48 return 0;
49 }
50