33 return "u8_buffer<" + std::string(
typeid(T).name()) +
">";
57 template <
class... Args>
58 constexpr holder(Args&&... args) noexcept
59 :
value(std::forward<Args>(args)...)
72 return std::move(
value);
80 [[nodiscard]]
constexpr const T&
storage() const noexcept
90 [[nodiscard]]
constexpr T&
storage() noexcept
102 value = std::move(other);
177 template <std::ranges::input_range R>
179 !std::same_as<u8_buffer<T>, std::decay_t<R>>
180 && std::convertible_to<std::ranges::range_value_t<R>, T>
216 template <allocator A>
217 constexpr u8_buffer(T* data_ptr, std::size_t count,
const A& a);
246 std::fill(this->
begin(), this->
end(), val);
250 template <std::ranges::input_range R>
252 !std::same_as<u8_buffer<T>, std::decay_t<R>> && std::convertible_to<std::ranges::range_value_t<R>, T>
264 std::copy(ilist.begin(), ilist.end(), this->begin());
268 template <allocator A>
270 :
holder_type{reinterpret_cast<uint8_t*>(data_ptr), count * sizeof(T), a}
constexpr iterator begin() noexcept
constexpr size_type size() const noexcept(!SPARROW_CONTRACTS_THROW_ON_FAILURE)
constexpr buffer_adaptor(FromBufferRef buf)
constexpr iterator end() noexcept
Object that owns a piece of contiguous memory.
xsimd::aligned_allocator< std::uint8_t > default_allocator
A holder class that wraps a value and provides storage management.
constexpr void assign(T &&other)
Assigns a new value to the storage.
constexpr T extract_storage() &&noexcept
Extracts the storage by moving the wrapped value.
constexpr T & storage() noexcept
Gets a reference to the storage.
constexpr holder(Args &&... args) noexcept
Constructs a holder with the given arguments forwarded to the wrapped value.
constexpr const T & storage() const noexcept
Gets a constant reference to the storage.
u8_buffer & operator=(u8_buffer &&other)=delete
Move assignment operator (deleted).
buffer_type::default_allocator default_allocator
constexpr u8_buffer(std::size_t n)
Constructs a buffer with n uninitialized elements.
constexpr u8_buffer(std::initializer_list< T > ilist)
Constructs a buffer with the elements of the initializer list ilist.
u8_buffer & operator=(u8_buffer &other)=delete
Copy assignment operator (deleted).
constexpr u8_buffer(T *data_ptr, std::size_t count, const A &a)
Constructs a buffer by taking ownership of the storage pointed to by data_ptr.
constexpr u8_buffer(const u8_buffer &other)
Copy constructor.
constexpr buffer_type extract_storage() &&noexcept
Extracts the storage by moving the wrapped value.
constexpr u8_buffer(R &&range)
Constructs a buffer with the elements of the range range.
detail::holder< buffer_type > holder_type
constexpr u8_buffer(std::size_t n, const T &val)
Constructs a buffer with n elements, each initialized to val.
buffer_adaptor< IT, buffer_type & > buffer_adaptor_type
~u8_buffer()=default
Destructor.
constexpr u8_buffer(u8_buffer &&other) noexcept
Move constructor.
buffer< std::uint8_t > buffer_type
std::string key_u8_buffer()
SPARROW_API void increase(const std::string &key)
constexpr std::ranges::copy_result< std::ranges::borrowed_iterator_t< R >, O > copy(R &&r, O result)
constexpr std::size_t range_size(R &&r)