From 0e1d3c5675a1cdcc56ba805091595cffc3f7fbda Mon Sep 17 00:00:00 2001 From: Daniel Cheng Date: Mon, 3 Apr 2023 15:51:18 -0700 Subject: [PATCH] Add reference, pointer, and co type aliases for rtc::ArrayView. Many STL containers define these type aliases, and they are easier to work with than add_const_t>. In a followup, `WTF::Vector` in Blink's conversion constructor from other containers will be SFINAE-guarded using these type aliases. Bug: chromium:1408442 Change-Id: I7790e6f462a32e7e49bc6468afeda6b2e6d4b631 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300180 Reviewed-by: Tomas Gunnarsson Commit-Queue: Daniel Cheng Cr-Commit-Position: refs/heads/main@{#39771} --- api/array_view.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/array_view.h b/api/array_view.h index 2d68f1650f..7e01959b01 100644 --- a/api/array_view.h +++ b/api/array_view.h @@ -149,6 +149,10 @@ template { public: using value_type = T; + using reference = value_type&; + using const_reference = const value_type&; + using pointer = value_type*; + using const_pointer = const value_type*; using const_iterator = const T*; // Construct an ArrayView from a pointer and a length.