piecewise.pass.cpp revision bc8d3f97eb5c958007f2713238472e0c1c8fe02c
1//===----------------------------------------------------------------------===//
2//
3// ��������������������The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
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    }
34#endif
35}
36