mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
AK: Add ReadonlySpan<T> as an alias for Span<T const>
This is a little clearer than Span<T const> where it looks like it's the T not the underlying array that's const.
This commit is contained in:
parent
b1793868b0
commit
8483efb399
Notes:
sideshowbarker
2024-07-17 06:28:38 +09:00
Author: https://github.com/MacDue Commit: https://github.com/SerenityOS/serenity/commit/8483efb399 Pull-request: https://github.com/SerenityOS/serenity/pull/17328 Reviewed-by: https://github.com/trflynn89
2 changed files with 9 additions and 2 deletions
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue