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 // <utility>
     11 
     12 // template <class T1, class T2> struct pair
     13 
     14 // template<size_t I, class T1, class T2>
     15 //     typename tuple_element<I, std::pair<T1, T2> >::type&
     16 //     get(pair<T1, T2>&);
     17 
     18 #include <utility>
     19 #include <cassert>
     20 
     21 int main()
     22 {
     23     {
     24         typedef std::pair<int, short> P;
     25         P p(3, 4);
     26         assert(std::get<0>(p) == 3);
     27         assert(std::get<1>(p) == 4);
     28         std::get<0>(p) = 5;
     29         std::get<1>(p) = 6;
     30         assert(std::get<0>(p) == 5);
     31         assert(std::get<1>(p) == 6);
     32     }
     33 }
     34