38 template <
class... Args>
48 return std::move(
value);
63 value = std::move(other);
100 template <std::ranges::input_range R>
102 !std::same_as<u8_buffer<T>, std::decay_t<R>>
103 && std::convertible_to<std::ranges::range_value_t<R>, T>
118 template <allocator A = std::allocator<T>>
119 u8_buffer(T* data_ptr, std::size_t count,
const A& a = A());
141 std::fill(this->
begin(), this->
end(), val);
145 template <std::ranges::input_range R>
146 requires(!std::same_as<u8_buffer<T>, std::decay_t<R>>
147 && std::convertible_to<std::ranges::range_value_t<R>, T>)
150 , buffer_adaptor_type(holder_type::value)
160 std::copy(ilist.begin(), ilist.end(), this->begin());
164 template <allocator A>
166 :
holder_type{reinterpret_cast<uint8_t*>(data_ptr), count * sizeof(T), a}
constexpr iterator begin() noexcept
buffer_adaptor(FromBufferRef buf)
constexpr size_type size() const noexcept
constexpr iterator end() noexcept
const T & storage() const
buffer< std::uint8_t > value
buffer_adaptor< T, buffer< std::uint8_t > & > buffer_adaptor_type
u8_buffer & operator=(u8_buffer &&other)=delete
u8_buffer(T *data_ptr, std::size_t count, const A &a=A())
Constructs a buffer by taking ownership of the storage pointed to by data_ptr.
u8_buffer & operator=(u8_buffer &other)=delete
buffer< std::uint8_t > extract_storage() &&
detail::holder< buffer< std::uint8_t > > holder_type
u8_buffer(R &&range)
Constructs a buffer with the elements of the range range.
u8_buffer(const u8_buffer &other)
u8_buffer(u8_buffer &&other)
u8_buffer(std::initializer_list< T > ilist)
Constructs a buffer with the elements of the initializer list ilist.
u8_buffer(std::size_t n, const T &val=T{})
Constructs a buffer with n elements, each initialized to val.
constexpr std::ranges::copy_result< std::ranges::borrowed_iterator_t< R >, O > copy(R &&r, O result)
std::size_t range_size(R &&r)