Home | History | Annotate | Download | only in pair.astuple
      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 // UNSUPPORTED: c++98, c++03
     11 
     12 // <utility>
     13 
     14 // template <class T1, class T2> struct pair
     15 
     16 // template<size_t I, class T1, class T2>
     17 //     typename tuple_element<I, std::pair<T1, T2> >::type&&
     18 //     get(pair<T1, T2>&&);
     19 
     20 #include <utility>
     21 #include <memory>
     22 #include <cassert>
     23 
     24 int main()
     25 {
     26     {
     27         typedef std::pair<std::unique_ptr<int>, short> P;
     28         P p(std::unique_ptr<int>(new int(3)), static_cast<short>(4));
     29         std::unique_ptr<int> ptr = std::get<0>(std::move(p));
     30         assert(*ptr == 3);
     31     }
     32 }
     33