35 constexpr Span() =
default;
37 template<concepts::ContiguousIterator Iter>
41 template<concepts::ContiguousIterator Iter, concepts::SizedSentinelFor<Iter> Sent>
46 template<types::
size_t size>
49 template<concepts::QualificationConvertibleTo<T> U, types::
size_t size>
52 template<
typename U, types::
size_t size>
56 template<concepts::ContiguousContainer Con>
62 template<concepts::QualificationConvertibleTo<T> U, types::
size_t other_extent>
69 constexpr auto data() const -> T* {
return m_data; }
70 constexpr auto size() const ->
types::
size_t {
return m_size; }
72 constexpr auto span() const ->
Span {
return *
this; }
74 template<concepts::ImplicitLifetime U>
77 if (byte_offset +
sizeof(U) >
size()) {
80 return reinterpret_cast<U*
>(m_data + byte_offset);
83 template<concepts::ImplicitLifetime U>
86 if (byte_offset +
sizeof(U) >
size()) {
89 return reinterpret_cast<U const*
>(m_data + byte_offset);
92 template<concepts::ImplicitLifetime U>
95 return reinterpret_cast<U*
>(m_data + byte_offset);
98 template<concepts::ImplicitLifetime U>
101 return reinterpret_cast<U const*
>(m_data + byte_offset);
104 template<concepts::ImplicitLifetime U>
107 if (byte_offset +
sizeof(U) *
count >
size()) {
113 template<concepts::ImplicitLifetime U>
116 if (byte_offset +
sizeof(U) *
count >
size()) {
122 template<concepts::ImplicitLifetime U>
128 template<concepts::ImplicitLifetime U>
135 T* m_data {
nullptr };
139template<
typename Iter,
typename SentOrSize>
142template<
typename Con>
Definition constant_vector_interface.h:28
constexpr auto iterator(size_t index)
Definition constant_vector_interface.h:56
Definition optional_forward_declaration.h:5
Definition span_forward_declaration.h:10
constexpr auto span() const -> Span
Definition span_dynamic_size.h:72
constexpr Span(Iter iterator, types::size_t size)
Definition span_dynamic_size.h:39
constexpr auto data() const -> T *
Definition span_dynamic_size.h:69
auto typed_pointer(size_t byte_offset) const -> Optional< U const * >
Definition span_dynamic_size.h:85
constexpr Span(vocab::Array< U, size > &array)
Definition span_dynamic_size.h:50
auto typed_span_unchecked(size_t byte_offset, size_t count) const -> Span< U >
Definition span_dynamic_size.h:124
constexpr auto operator=(Span const &) -> Span &=default
constexpr Span(Span const &)=default
constexpr Span(Iter iterator, Sent sentinel)
Definition span_dynamic_size.h:44
constexpr Span(Con &&container)
Definition span_dynamic_size.h:60
T Value
Definition span_dynamic_size.h:32
constexpr Span(Span< U, other_extent > const &other)
Definition span_dynamic_size.h:63
auto typed_span_unchecked(size_t byte_offset, size_t count) const -> Span< U const >
Definition span_dynamic_size.h:130
auto typed_pointer_unchecked(size_t byte_offset) const -> U *
Definition span_dynamic_size.h:94
constexpr Span(T(&array)[size])
Definition span_dynamic_size.h:47
T ConstValue
Definition span_dynamic_size.h:33
constexpr auto size() const -> types::size_t
Definition span_dynamic_size.h:70
auto typed_pointer(size_t byte_offset) const -> Optional< U * >
Definition span_dynamic_size.h:76
auto typed_span(size_t byte_offset, size_t count) const -> Optional< Span< U const > >
Definition span_dynamic_size.h:115
constexpr Span(vocab::Array< U, size > const &array)
Definition span_dynamic_size.h:54
auto typed_span(size_t byte_offset, size_t count) const -> Optional< Span< U > >
Definition span_dynamic_size.h:106
auto typed_pointer_unchecked(size_t byte_offset) const -> U const *
Definition span_dynamic_size.h:100
Definition borrowed_container.h:8
Definition operations.h:99
Definition language.h:110
Definition operations.h:75
Definition sized_container.h:8
std::size_t size_t
Definition size_t.h:12
constexpr auto to_address
Definition to_address.h:22
Span(Iter, SentOrSize) -> Span< meta::RemoveReference< meta::IteratorReference< Iter > > >
constexpr auto nullopt
Definition nullopt.h:15
constexpr auto dynamic_extent
Definition span_forward_declaration.h:7
constexpr auto size
Definition size.h:54
constexpr auto count
Definition count.h:37
Definition span_fixed_size.h:37