text: // Copyright 2020 The Fuchsia Authors. All rights reserved.
  // Use of this source code is governed by a BSD-style license that can be
  // found in the LICENSE file.
  
  #ifndef LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_INTERNAL_ARRAY_H_
  #define LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_INTERNAL_ARRAY_H_
  
  #include <array>
  
  namespace cpp20 {
  namespace internal {
  
  template <class T, std::size_t N, std::size_t... I>
  constexpr std::array<std::remove_cv_t<T>, N> to_array(T (&a)[N], std::index_sequence<I...>) {
    return {{a[I]...}};
  }
  
  template <class T, std::size_t N, std::size_t... I>
  constexpr std::array<std::remove_cv_t<T>, N> to_array(T(&&a)[N], std::index_sequence<I...>) {
    return {{std::move(a[I])...}};
  }
  
  }  // namespace internal
  }  // namespace cpp20
  
  #endif  // LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_INTERNAL_ARRAY_H_
  