blob: 42a2666dd04b4fb8d876e852063ad67c9c9ae42d [file] [log] [blame]
Howard Hinnant3e519522010-05-11 19:42:16 +00001//===----------------------------------------------------------------------===//
2//
Howard Hinnant5b08a8a2010-05-11 21:36:01 +00003// The LLVM Compiler Infrastructure
Howard Hinnant3e519522010-05-11 19:42:16 +00004//
Howard Hinnant412dbeb2010-11-16 22:09:02 +00005// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
Howard Hinnant3e519522010-05-11 19:42:16 +00007//
8//===----------------------------------------------------------------------===//
9
10// <utility>
11
12// template <class T1, class T2> struct pair
13
14// template <class... Args1, class... Args2>
15// pair(piecewise_construct_t, tuple<Args1...> first_args,
16// tuple<Args2...> second_args);
17
18#include <utility>
19#include <tuple>
20#include <cassert>
21
22int main()
23{
24#ifndef _LIBCPP_HAS_NO_VARIADICS
25 {
26 typedef std::pair<int, int*> P1;
27 typedef std::pair<int*, int> P2;
28 typedef std::pair<P1, P2> P3;
29 P3 p3(std::piecewise_construct, std::tuple<int, int*>(3, nullptr),
30 std::tuple<int*, int>(nullptr, 4));
31 assert(p3.first == P1(3, nullptr));
32 assert(p3.second == P2(nullptr, 4));
33 }
Howard Hinnant94b2dd02010-08-22 00:59:46 +000034#endif // _LIBCPP_HAS_NO_VARIADICS
Howard Hinnant3e519522010-05-11 19:42:16 +000035}