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... UTypes> 15 // explicit tuple(UTypes&&... u); 16 17 #include <tuple> 18 #include <cassert> 19 20 #include "../MoveOnly.h" 21 22 int main() 23 { 24 { 25 std::tuple<MoveOnly> t(MoveOnly(0)); 26 assert(std::get<0>(t) == 0); 27 } 28 { 29 std::tuple<MoveOnly, MoveOnly> t(MoveOnly(0), MoveOnly(1)); 30 assert(std::get<0>(t) == 0); 31 assert(std::get<1>(t) == 1); 32 } 33 { 34 std::tuple<MoveOnly, MoveOnly, MoveOnly> t(MoveOnly(0), 35 MoveOnly(1), 36 MoveOnly(2)); 37 assert(std::get<0>(t) == 0); 38 assert(std::get<1>(t) == 1); 39 assert(std::get<2>(t) == 2); 40 } 41 // extensions 42 { 43 std::tuple<MoveOnly, MoveOnly, MoveOnly> t(MoveOnly(0), 44 MoveOnly(1)); 45 assert(std::get<0>(t) == 0); 46 assert(std::get<1>(t) == 1); 47 assert(std::get<2>(t) == MoveOnly()); 48 } 49 { 50 std::tuple<MoveOnly, MoveOnly, MoveOnly> t(MoveOnly(0)); 51 assert(std::get<0>(t) == 0); 52 assert(std::get<1>(t) == MoveOnly()); 53 assert(std::get<2>(t) == MoveOnly()); 54 } 55 } 56