diff options
author | AnotherTest <ali.mpfard@gmail.com> | 2021-04-10 18:29:06 +0430 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-04-10 21:01:31 +0200 |
commit | a6e448208052c2d03fca53a4061a367b33167d37 (patch) | |
tree | 0d6f84d1257e2af57d28a3102d0622fcf716782b /AK/Span.h | |
parent | d8d16dea957f15f07ebb08d1578e21d97fc163bc (diff) | |
download | serenity-a6e448208052c2d03fca53a4061a367b33167d37.zip |
AK+Everywhere: Make StdLibExtras templates less wrapper-y
This commit makes the user-facing StdLibExtras templates and utilities
arguably more nice-looking by removing the need to reach into the
wrapper structs generated by them to get the value/type needed.
The C++ standard library had to invent `_v` and `_t` variants (likely
because of backwards compat), but we don't need to cater to any codebase
except our own, so might as well have good things for free. :^)
Diffstat (limited to 'AK/Span.h')
-rw-r--r-- | AK/Span.h | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -167,16 +167,16 @@ public: __builtin_memcpy(this->data() + offset, data, data_size); } - ALWAYS_INLINE constexpr size_t copy_to(Span<typename RemoveConst<T>::Type> other) const + ALWAYS_INLINE constexpr size_t copy_to(Span<RemoveConst<T>> other) const { VERIFY(other.size() >= size()); - return TypedTransfer<typename RemoveConst<T>::Type>::copy(other.data(), data(), size()); + return TypedTransfer<RemoveConst<T>>::copy(other.data(), data(), size()); } - ALWAYS_INLINE constexpr size_t copy_trimmed_to(Span<typename RemoveConst<T>::Type> other) const + ALWAYS_INLINE constexpr size_t copy_trimmed_to(Span<RemoveConst<T>> other) const { const auto count = min(size(), other.size()); - return TypedTransfer<typename RemoveConst<T>::Type>::copy(other.data(), data(), count); + return TypedTransfer<RemoveConst<T>>::copy(other.data(), data(), count); } ALWAYS_INLINE constexpr size_t fill(const T& value) |