Fix array_view nested namespace.
Bug: webrtc:13075
Change-Id: I4160966487b5a596ade78033081e8dc0a4e11c99
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228944
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34771}
diff --git a/api/array_view.h b/api/array_view.h
index df365cb..2d68f16 100644
--- a/api/array_view.h
+++ b/api/array_view.h
@@ -84,7 +84,7 @@
// a pointer if fix-sized) and trivially copyable, so it's probably cheaper to
// pass it by value than by const reference.
-namespace impl {
+namespace array_view_internal {
// Magic constant for indicating that the size of an ArrayView is variable
// instead of fixed.
@@ -125,7 +125,7 @@
// Specialized base class for ArrayViews of variable size.
template <typename T>
-class ArrayViewBase<T, impl::kArrayViewVarSize> {
+class ArrayViewBase<T, array_view_internal::kArrayViewVarSize> {
public:
ArrayViewBase(T* data, size_t size)
: data_(size == 0 ? nullptr : data), size_(size) {}
@@ -142,10 +142,11 @@
size_t size_;
};
-} // namespace impl
+} // namespace array_view_internal
-template <typename T, std::ptrdiff_t Size = impl::kArrayViewVarSize>
-class ArrayView final : public impl::ArrayViewBase<T, Size> {
+template <typename T,
+ std::ptrdiff_t Size = array_view_internal::kArrayViewVarSize>
+class ArrayView final : public array_view_internal::ArrayViewBase<T, Size> {
public:
using value_type = T;
using const_iterator = const T*;
@@ -153,7 +154,7 @@
// Construct an ArrayView from a pointer and a length.
template <typename U>
ArrayView(U* data, size_t size)
- : impl::ArrayViewBase<T, Size>::ArrayViewBase(data, size) {
+ : array_view_internal::ArrayViewBase<T, Size>::ArrayViewBase(data, size) {
RTC_DCHECK_EQ(size == 0 ? nullptr : data, this->data());
RTC_DCHECK_EQ(size, this->size());
RTC_DCHECK_EQ(!this->data(),
@@ -167,7 +168,8 @@
: ArrayView() {}
ArrayView(std::nullptr_t, size_t size)
: ArrayView(static_cast<T*>(nullptr), size) {
- static_assert(Size == 0 || Size == impl::kArrayViewVarSize, "");
+ static_assert(Size == 0 || Size == array_view_internal::kArrayViewVarSize,
+ "");
RTC_DCHECK_EQ(0, size);
}
@@ -175,7 +177,7 @@
template <typename U, size_t N>
ArrayView(U (&array)[N]) // NOLINT
: ArrayView(array, N) {
- static_assert(Size == N || Size == impl::kArrayViewVarSize,
+ static_assert(Size == N || Size == array_view_internal::kArrayViewVarSize,
"Array size must match ArrayView size");
}
@@ -208,7 +210,7 @@
// N> when M != N.
template <
typename U,
- typename std::enable_if<Size != impl::kArrayViewVarSize &&
+ typename std::enable_if<Size != array_view_internal::kArrayViewVarSize &&
HasDataAndSize<U, T>::value>::type* = nullptr>
ArrayView(U& u) // NOLINT
: ArrayView(u.data(), u.size()) {
@@ -216,7 +218,7 @@
}
template <
typename U,
- typename std::enable_if<Size != impl::kArrayViewVarSize &&
+ typename std::enable_if<Size != array_view_internal::kArrayViewVarSize &&
HasDataAndSize<U, T>::value>::type* = nullptr>
ArrayView(const U& u) // NOLINT(runtime/explicit)
: ArrayView(u.data(), u.size()) {
@@ -236,13 +238,13 @@
// const rtc::Buffer to ArrayView<const uint8_t>.
template <
typename U,
- typename std::enable_if<Size == impl::kArrayViewVarSize &&
+ typename std::enable_if<Size == array_view_internal::kArrayViewVarSize &&
HasDataAndSize<U, T>::value>::type* = nullptr>
ArrayView(U& u) // NOLINT
: ArrayView(u.data(), u.size()) {}
template <
typename U,
- typename std::enable_if<Size == impl::kArrayViewVarSize &&
+ typename std::enable_if<Size == array_view_internal::kArrayViewVarSize &&
HasDataAndSize<U, T>::value>::type* = nullptr>
ArrayView(const U& u) // NOLINT(runtime/explicit)
: ArrayView(u.data(), u.size()) {}