Go to the documentation of this file.
4 #ifndef LEXY_DETAIL_BUFFER_BUILDER_HPP_INCLUDED
5 #define LEXY_DETAIL_BUFFER_BUILDER_HPP_INCLUDED
21 static_assert(std::is_trivial_v<T>);
31 static_assert(
sizeof(*
this) ==
total_size_bytes,
"invalid buffer size calculation");
38 ::operator
delete(
_data);
92 auto memory =
static_cast<T*
>(::operator
new(new_cap *
sizeof(T)));
98 ::operator
delete(
_data);
114 std::size_t idx) noexcept
118 constexpr
const T&
deref() const noexcept
133 return !
_buffer && !rhs._buffer;
137 return _idx == rhs._idx;
141 constexpr std::size_t
index() const noexcept
159 #endif // LEXY_DETAIL_BUFFER_BUILDER_HPP_INCLUDED
constexpr stable_iterator()=default
const T * read_data() const noexcept
T * write_data() noexcept
#define LEXY_PRECONDITION(Expr)
constexpr bool equal(stable_iterator rhs) const noexcept
static constexpr std::size_t stack_buffer_size
constexpr stable_iterator(const _detail::buffer_builder< T > &buffer, std::size_t idx) noexcept
const _detail::buffer_builder< T > * _buffer
T _stack_buffer[stack_buffer_size]
constexpr auto n() noexcept
std::size_t read_size() const noexcept
constexpr void increment() noexcept
buffer_builder & operator=(const buffer_builder &)=delete
static constexpr auto growth_factor
buffer_builder() noexcept
constexpr std::size_t index() const noexcept
void commit(std::size_t n) noexcept
static constexpr std::size_t total_size_bytes
std::size_t capacity() const noexcept
~buffer_builder() noexcept
std::size_t write_size() const noexcept
constexpr const T & deref() const noexcept