summaryrefslogtreecommitdiff
path: root/AK
diff options
context:
space:
mode:
Diffstat (limited to 'AK')
-rw-r--r--AK/Forward.h5
-rw-r--r--AK/Span.h6
2 files changed, 9 insertions, 2 deletions
diff --git a/AK/Forward.h b/AK/Forward.h
index e258449ffd..3f67a9fd8a 100644
--- a/AK/Forward.h
+++ b/AK/Forward.h
@@ -61,7 +61,10 @@ struct Array;
template<typename Container, typename ValueType>
class SimpleIterator;
-using ReadonlyBytes = Span<u8 const>;
+template<typename T>
+using ReadonlySpan = Span<T const>;
+
+using ReadonlyBytes = ReadonlySpan<u8>;
using Bytes = Span<u8>;
template<typename T, AK::MemoryOrder DefaultMemoryOrder>
diff --git a/AK/Span.h b/AK/Span.h
index 79798c1527..c4ffe3c9b5 100644
--- a/AK/Span.h
+++ b/AK/Span.h
@@ -271,7 +271,10 @@ struct Traits<Span<T>> : public GenericTraits<Span<T>> {
constexpr static bool is_trivial() { return true; }
};
-using ReadonlyBytes = Span<u8 const>;
+template<typename T>
+using ReadonlySpan = Span<T const>;
+
+using ReadonlyBytes = ReadonlySpan<u8>;
using Bytes = Span<u8>;
}
@@ -279,5 +282,6 @@ using Bytes = Span<u8>;
#if USING_AK_GLOBALLY
using AK::Bytes;
using AK::ReadonlyBytes;
+using AK::ReadonlySpan;
using AK::Span;
#endif