Revert "[libc] Use best-fit binary trie to make malloc logarithmic" (#117065)
[llvm-project.git] / libcxx / test / std / utilities / utility / pairs / pair.astuple / get_rv.pass.cpp
blob2a81c490eccd7e6d60a4164a9ca5d31ed67ec22c
1 //===----------------------------------------------------------------------===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03
11 // <utility>
13 // template <class T1, class T2> struct pair
15 // template<size_t I, class T1, class T2>
16 // typename tuple_element<I, std::pair<T1, T2> >::type&&
17 // get(pair<T1, T2>&&);
19 #include <utility>
20 #include <memory>
21 #include <cassert>
23 #include "test_macros.h"
25 int main(int, char**)
28 typedef std::pair<std::unique_ptr<int>, short> P;
29 P p(std::unique_ptr<int>(new int(3)), static_cast<short>(4));
30 std::unique_ptr<int> ptr = std::get<0>(std::move(p));
31 assert(*ptr == 3);
34 return 0;