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 <size_t I, class... Types> 15 // typename tuple_element<I, tuple<Types...> >::type&& 16 // get(tuple<Types...>&& t); 17 18 #include <tuple> 19 #include <memory> 20 #include <cassert> 21 22 int main() 23 { 24 { 25 typedef std::tuple<std::unique_ptr<int> > T; 26 T t(std::unique_ptr<int>(new int(3))); 27 std::unique_ptr<int> p = std::get<0>(std::move(t)); 28 assert(*p == 3); 29 } 30 } 31