[NFC][analyzer][docs] Improve Annotations.rst (#122749)
[llvm-project.git] / libcxx / test / std / containers / sequences / array / array.tuple / get_rv.pass.cpp
blob2ab8acbcfdc2aafa5838ccd39f12530010f2aa94
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 // <array>
11 // template <size_t I, class T, size_t N> T&& get(array<T, N>&& a);
13 // UNSUPPORTED: c++03
15 #include <array>
16 #include <memory>
17 #include <utility>
18 #include <cassert>
20 #include "test_macros.h"
22 int main(int, char**)
25 typedef std::unique_ptr<double> T;
26 typedef std::array<T, 1> C;
27 C c = {std::unique_ptr<double>(new double(3.5))};
28 T t = std::get<0>(std::move(c));
29 assert(*t == 3.5);
32 return 0;