Bug: webrtc:439801349 Change-Id: I61cdbef2b6f5e30b561766356258a463087db9de Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/461280 Auto-Submit: Danil Chapovalov <danilchap@webrtc.org> Commit-Queue: Evan Shrubsole <eshr@webrtc.org> Reviewed-by: Evan Shrubsole <eshr@webrtc.org> Cr-Commit-Position: refs/heads/main@{#47302}
32 lines
861 B
C++
32 lines
861 B
C++
/*
|
|
* Copyright 2015 The WebRTC Project Authors. All rights reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
|
|
#ifndef API_ARRAY_VIEW_H_
|
|
#define API_ARRAY_VIEW_H_
|
|
|
|
#include <cstddef>
|
|
#include <span>
|
|
|
|
namespace webrtc {
|
|
|
|
template <typename T, size_t extent = std::dynamic_extent>
|
|
using ArrayView = std::span<T, extent>;
|
|
|
|
// TODO: bugs.webrtc.org/439801349 - deprecate when unused by WebRTC
|
|
template <typename T>
|
|
inline ArrayView<T> MakeArrayView(T* data, size_t size) {
|
|
return ArrayView<T>(data, size);
|
|
}
|
|
|
|
} // namespace webrtc
|
|
|
|
|
|
#endif // API_ARRAY_VIEW_H_
|