30 #ifndef CONST_BUFFER_HPP 31 #define CONST_BUFFER_HPP 75 return data ==
nullptr;
120 static_assert(
sizeof(T) > 0,
"Empty base type");
122 assert(other.
size %
sizeof(T) == 0);
125 other.
size /
sizeof(T));
129 static_assert(
sizeof(T) > 0,
"Empty base type");
134 return data ==
nullptr;
144 for (
const auto &i : *
this)
256 assert(
IsNull() == (new_data ==
nullptr));
257 assert(new_data <=
end());
constexpr ConstBuffer(std::nullptr_t)
void MoveFront(pointer_type new_data)
Move the front pointer to the given address, and adjust the size attribute to retain the old end addr...
pointer_type const_iterator
constexpr bool IsEmpty() const
gcc_pure bool Contains(U &&u) const noexcept
void pop_back()
Remove the last element (by moving the tail pointer, does not actually modify the buffer)...
pointer_type const_iterator
static ConstBuffer< T > FromVoid(ConstBuffer< void > other)
Cast a ConstBuffer<void> to a ConstBuffer<T>.
static constexpr ConstBuffer Null()
constexpr ConstBuffer(pointer_type _data, size_type _size)
const void * pointer_type
constexpr ConstBuffer(pointer_type _data, size_type _size)
constexpr const_iterator cend() const
constexpr bool IsNull() const
constexpr ConstBuffer< void > ToVoid() const
constexpr const_iterator cbegin() const
constexpr ConstBuffer(std::nullptr_t)
reference_type front() const
Returns a reference to the first element.
static constexpr ConstBuffer< void > FromVoid(ConstBuffer< void > other)
void pop_front()
Remove the first element (by moving the head pointer, does not actually modify the buffer)...
constexpr ConstBuffer< void > ToVoid() const
reference_type operator[](size_type i) const
constexpr iterator end() const
reference_type shift()
Remove the first element and return a reference to it.
constexpr bool IsEmpty() const
constexpr bool IsNull() const
reference_type const_reference_type
A reference to a memory area that is read-only.
constexpr iterator begin() const
static constexpr ConstBuffer Null()
pointer_type const_pointer_type
void skip_front(size_type n)
reference_type back() const
Returns a reference to the last element.
pointer_type const_pointer_type