Home | History | Annotate | Download | only in tuple.elem
      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 // UNSUPPORTED: c++98, c++03
     19 
     20 #include <tuple>
     21 #include <utility>
     22 #include <memory>
     23 #include <cassert>
     24 
     25 int main()
     26 {
     27     {
     28         typedef std::tuple<std::unique_ptr<int> > T;
     29         T t(std::unique_ptr<int>(new int(3)));
     30         std::unique_ptr<int> p = std::get<0>(std::move(t));
     31         assert(*p == 3);
     32     }
     33 }
     34