summaryrefslogtreecommitdiff
path: root/AK/Span.h
AgeCommit message (Collapse)Author
2020-12-19AK: Mark some Span functions with [[nodiscard]]Andreas Kling
I was confused by the trim() API, thinking it would mutate the span it was called on. Mark all const functions that return a new span with [[nodiscard]] so we can catch such mistakes.
2020-12-19LibTLS+LibCrypto: More ByteBuffer -> Span conversionAndreas Kling
2020-12-19LibTLS+LibCrypto: Replace a whole bunch of ByteBuffers with SpansAndreas Kling
2020-10-16Span: constexpr supportLenny Maiorani
Problem: - `Span` is not `constexpr` aware. Solution: - Add `constexpr` support for all parts that do not require `reinterpret_cast`. - Modify tests which use the `constexpr` functions.
2020-09-21AK: Add missing const in Span::operator==.asynts
2020-09-15AK: Add OutputMemoryStream::fill_to_end.asynts
2020-09-09AK: Use TypedTransfer in Span::copy_to.asynts
2020-09-08Refactor: Replace usages of FixedArray with Vector.asynts
2020-09-08AK: Add generic SimpleIterator class to replace VectorIterator.asynts
2020-08-20AK: Span: Fix signature of copy_to() and copy_trimmed_to().asynts
Two changes were made 1. copy_to() and copy_trimmed_to() now return how many bytes were copied. 2. The argument was changed to Span<typename RemoveConst<T>::Type> because the following would not work: ReadonlyBytes bytes0; Bytes bytes1; // Won't work because this calls Span<const u8>::copy_to(Span<u8>) // but the method was defined as Span<const u8>::copy_to(Span<const u8>) bytes0.copy_to(bytes1);
2020-08-20AK: Span: Allow slicing with zero length.asynts
Previously, the following would not work: Bytes{}.slice(0); because it was asserted that `start < size()`.
2020-08-17AK: Always call memmove in Span instead of memcpy.asynts
https://github.com/SerenityOS/serenity/pull/3166#discussion_r471031704
2020-08-15AK: Add slice() overload to Span.asynts
2020-08-15AK: Add fill() method to Span.asynts
2020-08-15AK: Add copy_to() and move_to() methods to AK::Span.asynts
2020-08-15AK: Remove incorrect static assert in Span.h.asynts
This assertion was added to prevent accitentally using stuff like Span<int*> instead of Span<int>. But there can be spans of pointers.
2020-08-11AK: Span<T>::operator=(const T&) => Span<T>::operator=(const Span<T>&)AnotherTest
2020-07-27AK: Rename Span::subspan() to Span::slice().asynts
2020-07-27AK: Add offset() method to Span.asynts
2020-07-27AK: Add implicit conversion from nullptr to Span.asynts
2020-07-27AK: Add constructors to Bytes and ReadonlyBytes that take void pointers.asynts
2020-07-27AK: Define conversion from Span<T> to Span<const T> correctly.asynts
I accidently wrote `Span<RemoveConst<T>>` when I meant `Span<RemoveConst<T>::Type>`. Changing that wouldn't be enough though, this constructor can only be defined if T is not const, otherwise it would redefine the copy constructor. This can be avoided by overloading the cast operator.
2020-07-26AK: Implement Span which represents a contiguous sequence of objects.asynts
This makes it possible to pass one object rather than pointer and length individually.