xref: /llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.assign/const_pair.pass.cpp (revision 5a83710e371fe68a06e6e3876c6a2c8b820a8976)
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 U1, class U2>
15 //   tuple& operator=(const pair<U1, U2>& u);
16 
17 #include <tuple>
18 #include <utility>
19 #include <cassert>
20 
21 int main()
22 {
23     {
24         typedef std::pair<double, char> T0;
25         typedef std::tuple<int, short> T1;
26         T0 t0(2.5, 'a');
27         T1 t1;
28         t1 = t0;
29         assert(std::get<0>(t1) == 2);
30         assert(std::get<1>(t1) == short('a'));
31     }
32 }
33