3#ifndef TETL_NET_BUFFER_CONST_HPP
4#define TETL_NET_BUFFER_CONST_HPP
24 [[nodiscard]]
auto data() const noexcept ->
void const* {
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 const*
>(_data) + offset;
39 void const* _data =
nullptr;
48 auto offset = n < b.size() ? n : b.size();
49 auto const*
data =
static_cast<char const*
>(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+(const_buffer const &b, etl::size_t const n) noexcept -> const_buffer
Create a new modifiable buffer that is offset from the start of another.
Definition buffer_const.hpp:46
auto operator+=(etl::size_t n) noexcept -> const_buffer &
Move the start of the buffer by the specified number of bytes.
Definition buffer_const.hpp:30
const_buffer() noexcept=default
Construct an empty buffer.
auto operator+(etl::size_t const n, const_buffer const &b) noexcept -> const_buffer
Create a new modifiable buffer that is offset from the start of another.
Definition buffer_const.hpp:57
auto data() const noexcept -> void const *
Get a pointer to the beginning of the memory range.
Definition buffer_const.hpp:24
auto size() const noexcept -> etl::size_t
Get the size of the memory range.
Definition buffer_const.hpp:27