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 //===----------------------------------------------------------------------===//
11 // template <class T1, class T2> pair<V1, V2> make_pair(T1&&, T2&&);
17 #include "test_macros.h"
22 typedef std::pair
<int, short> P1
;
23 P1 p1
= std::make_pair(3, static_cast<short>(4));
24 assert(p1
.first
== 3);
25 assert(p1
.second
== 4);
28 #if TEST_STD_VER >= 11
30 typedef std::pair
<std::unique_ptr
<int>, short> P1
;
31 P1 p1
= std::make_pair(std::unique_ptr
<int>(new int(3)), static_cast<short>(4));
32 assert(*p1
.first
== 3);
33 assert(p1
.second
== 4);
36 typedef std::pair
<std::unique_ptr
<int>, short> P1
;
37 P1 p1
= std::make_pair(nullptr, static_cast<short>(4));
38 assert(p1
.first
== nullptr);
39 assert(p1
.second
== 4);
42 #if TEST_STD_VER >= 14
44 typedef std::pair
<int, short> P1
;
45 constexpr P1 p1
= std::make_pair(3, static_cast<short>(4));
46 static_assert(p1
.first
== 3, "");
47 static_assert(p1
.second
== 4, "");