Howard Hinnant | cd2254b | 2010-11-17 19:52:17 +0000 | [diff] [blame] | 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 | |
Eric Fiselier | 02bb4bd | 2015-07-18 23:56:04 +0000 | [diff] [blame] | 14 | // UNSUPPORTED: c++98, c++03 |
| 15 | |
Howard Hinnant | cd2254b | 2010-11-17 19:52:17 +0000 | [diff] [blame] | 16 | #include <array> |
| 17 | #include <memory> |
Marshall Clow | 6b913d7 | 2015-01-09 20:25:52 +0000 | [diff] [blame] | 18 | #include <utility> |
Howard Hinnant | cd2254b | 2010-11-17 19:52:17 +0000 | [diff] [blame] | 19 | #include <cassert> |
| 20 | |
Dan Albert | 1d4a1ed | 2016-05-25 22:36:09 -0700 | [diff] [blame^] | 21 | #include "../suppress_array_warnings.h" |
Eric Fiselier | 02bb4bd | 2015-07-18 23:56:04 +0000 | [diff] [blame] | 22 | |
Howard Hinnant | cd2254b | 2010-11-17 19:52:17 +0000 | [diff] [blame] | 23 | int main() |
| 24 | { |
Eric Fiselier | 02bb4bd | 2015-07-18 23:56:04 +0000 | [diff] [blame] | 25 | |
Howard Hinnant | cd2254b | 2010-11-17 19:52:17 +0000 | [diff] [blame] | 26 | { |
| 27 | typedef std::unique_ptr<double> T; |
| 28 | typedef std::array<T, 1> C; |
| 29 | C c = {std::unique_ptr<double>(new double(3.5))}; |
| 30 | T t = std::get<0>(std::move(c)); |
| 31 | assert(*t == 3.5); |
| 32 | } |
Howard Hinnant | cd2254b | 2010-11-17 19:52:17 +0000 | [diff] [blame] | 33 | } |