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