brintos

brintos / llvm-project-archived public Read only

0
0
Text · 806 B · 460219b Raw
33 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9// <array>10 11// template <size_t I, class T, size_t N> T&& get(array<T, N>&& a);12 13// UNSUPPORTED: c++0314 15#include <array>16#include <memory>17#include <utility>18#include <cassert>19 20#include "test_macros.h"21 22int main(int, char**) {23  {24    typedef std::unique_ptr<double> T;25    typedef std::array<T, 1> C;26    C c = {std::unique_ptr<double>(new double(3.5))};27    T t = std::get<0>(std::move(c));28    assert(*t == 3.5);29  }30 31  return 0;32}33