get_rv.pass.cpp revision cd2254b454e9398d1287e44630f3ac654cf9f43c
1//===----------------------------------------------------------------------===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10// <array>
11
12// template <size_t I, class T, size_t N> T&& get(array<T, N>&& a);
13
14#include <array>
15#include <memory>
16#include <cassert>
17
18int main()
19{
20#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
21    {
22        typedef std::unique_ptr<double> T;
23        typedef std::array<T, 1> C;
24        C c = {std::unique_ptr<double>(new double(3.5))};
25        T t = std::get<0>(std::move(c));
26        assert(*t == 3.5);
27    }
28#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
29}
30