Loading...
Searching...
No Matches
v8-memory-span.h
Go to the documentation of this file.
1// Copyright 2021 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef INCLUDE_V8_MEMORY_SPAN_H_
6#define INCLUDE_V8_MEMORY_SPAN_H_
7
8#include <array>
9#include <span>
10
11#include "v8config.h" // NOLINT(build/include_directory)
12
13namespace v8 {
14
20template <typename T>
21using MemorySpan V8_DEPRECATE_SOON("Use std::span instead.") = std::span<T>;
22
33template <typename T, std::size_t N>
34V8_DEPRECATE_SOON("Use std::to_array instead.")
35[[nodiscard]] constexpr std::array<std::remove_cv_t<T>, N> to_array(T (&a)[N]) {
36 return std::to_array(a);
37}
38
39template <typename T, std::size_t N>
40V8_DEPRECATE_SOON("Use std::to_array instead.")
41[[nodiscard]] constexpr std::array<std::remove_cv_t<T>, N> to_array(
42 T (&&a)[N]) {
43 return std::to_array(std::move(a));
44}
45
46} // namespace v8
47
48#endif // INCLUDE_V8_MEMORY_SPAN_H_
Definition: libplatform.h:15
std::span< T > MemorySpan
Definition: v8-memory-span.h:21
constexpr std::array< std::remove_cv_t< T >, N > to_array(T(&a)[N])
Definition: v8-memory-span.h:35
#define V8_DEPRECATE_SOON(message)
Definition: v8config.h:624