• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 // tuple& operator=(const tuple& u);
15 
16 #include <tuple>
17 #include <string>
18 #include <cassert>
19 
main()20 int main()
21 {
22     {
23         typedef std::tuple<> T;
24         T t0;
25         T t;
26         t = t0;
27     }
28     {
29         typedef std::tuple<int> T;
30         T t0(2);
31         T t;
32         t = t0;
33         assert(std::get<0>(t) == 2);
34     }
35     {
36         typedef std::tuple<int, char> T;
37         T t0(2, 'a');
38         T t;
39         t = t0;
40         assert(std::get<0>(t) == 2);
41         assert(std::get<1>(t) == 'a');
42     }
43     {
44         typedef std::tuple<int, char, std::string> T;
45         const T t0(2, 'a', "some text");
46         T t;
47         t = t0;
48         assert(std::get<0>(t) == 2);
49         assert(std::get<1>(t) == 'a');
50         assert(std::get<2>(t) == "some text");
51     }
52 }
53