From 8483efb399faa961f26c3ff4273bf424e75a3157 Mon Sep 17 00:00:00 2001 From: MacDue Date: Sun, 5 Feb 2023 17:59:03 +0000 Subject: [PATCH] AK: Add ReadonlySpan as an alias for Span This is a little clearer than Span where it looks like it's the T not the underlying array that's const. --- AK/Forward.h | 5 ++++- AK/Span.h | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/AK/Forward.h b/AK/Forward.h index e258449ffdc..3f67a9fd8a9 100644 --- a/AK/Forward.h +++ b/AK/Forward.h @@ -61,7 +61,10 @@ struct Array; template class SimpleIterator; -using ReadonlyBytes = Span; +template +using ReadonlySpan = Span; + +using ReadonlyBytes = ReadonlySpan; using Bytes = Span; template diff --git a/AK/Span.h b/AK/Span.h index 79798c15275..c4ffe3c9b53 100644 --- a/AK/Span.h +++ b/AK/Span.h @@ -271,7 +271,10 @@ struct Traits> : public GenericTraits> { constexpr static bool is_trivial() { return true; } }; -using ReadonlyBytes = Span; +template +using ReadonlySpan = Span; + +using ReadonlyBytes = ReadonlySpan; using Bytes = Span; } @@ -279,5 +282,6 @@ using Bytes = Span; #if USING_AK_GLOBALLY using AK::Bytes; using AK::ReadonlyBytes; +using AK::ReadonlySpan; using AK::Span; #endif