3#ifndef TETL_NET_BUFFER_MUTABLE_HPP
4#define TETL_NET_BUFFER_MUTABLE_HPP
24 [[nodiscard]]
auto data() const noexcept ->
void* {
return _data; }
27 [[nodiscard]]
auto size() const noexcept ->
etl::
size_t {
return _size; }
32 auto const offset = n < _size ? n : _size;
33 _data =
static_cast<char*
>(_data) + offset;
39 void* _data =
nullptr;
48 auto offset = n < b.size() ? n : b.size();
49 auto*
data =
static_cast<char*
>(b.data()) + offset;
50 auto size = b.size() - offset;
constexpr auto size(C const &c) noexcept(noexcept(c.size())) -> decltype(c.size())
Returns the size of the given container c or array array. Returns c.size(), converted to the return t...
Definition size.hpp:18
Definition adjacent_find.hpp:8
TETL_BUILTIN_SIZET size_t
etl::size_t is the unsigned integer type of the result of the sizeof operator.
Definition size_t.hpp:14
auto operator+=(etl::size_t n) noexcept -> mutable_buffer &
Move the start of the buffer by the specified number of bytes.
Definition buffer_mutable.hpp:30
auto data() const noexcept -> void *
Get a pointer to the beginning of the memory range.
Definition buffer_mutable.hpp:24
auto operator+(etl::size_t const n, mutable_buffer const &b) noexcept -> mutable_buffer
Create a new modifiable buffer that is offset from the start of another.
Definition buffer_mutable.hpp:57
auto operator+(mutable_buffer const &b, etl::size_t const n) noexcept -> mutable_buffer
Create a new modifiable buffer that is offset from the start of another.
Definition buffer_mutable.hpp:46
mutable_buffer() noexcept=default
Construct an empty buffer.
auto size() const noexcept -> etl::size_t
Get the size of the memory range.
Definition buffer_mutable.hpp:27