1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
13 // template <class T1, class T2> struct pair
15 // template <class... Args1, class... Args2>
16 // pair(piecewise_construct_t, tuple<Args1...> first_args,
17 // tuple<Args2...> second_args);
23 #include "test_macros.h"
25 TEST_CONSTEXPR_CXX20
bool test() {
27 typedef std::pair
<int, int*> P1
;
28 typedef std::pair
<int*, int> P2
;
29 typedef std::pair
<P1
, P2
> P3
;
30 P3
p3(std::piecewise_construct
, std::tuple
<int, int*>(3, nullptr),
31 std::tuple
<int*, int>(nullptr, 4));
32 assert(p3
.first
== P1(3, nullptr));
33 assert(p3
.second
== P2(nullptr, 4));
38 int main(int, char**) {
40 #if TEST_STD_VER >= 20
41 static_assert(test());