36 constexpr Span() =
default;
38 template<concepts::ContiguousIterator Iter>
42 template<concepts::ContiguousIterator Iter, concepts::SizedSentinelFor<Iter> Sent>
47 template<types::
size_t size>
50 template<concepts::QualificationConvertibleTo<T> U, types::
size_t size>
53 template<
typename U, types::
size_t size>
57 template<concepts::ContiguousContainer Con>
63 template<concepts::QualificationConvertibleTo<T> U, types::
size_t other_extent>
70 constexpr auto data() const -> T* {
return m_data; }
71 constexpr auto size() const ->
types::
size_t {
return m_size; }
73 constexpr auto span() const ->
Span {
return *
this; }
75 template<concepts::ImplicitLifetime U>
78 if (byte_offset +
sizeof(U) >
size()) {
81 return reinterpret_cast<U*
>(m_data + byte_offset);
84 template<concepts::ImplicitLifetime U>
87 if (byte_offset +
sizeof(U) >
size()) {
90 return reinterpret_cast<U const*
>(m_data + byte_offset);
93 template<concepts::ImplicitLifetime U>
96 return reinterpret_cast<U*
>(m_data + byte_offset);
99 template<concepts::ImplicitLifetime U>
102 return reinterpret_cast<U const*
>(m_data + byte_offset);
105 template<concepts::ImplicitLifetime U>
108 if (byte_offset +
sizeof(U) *
count >
size()) {
114 template<concepts::ImplicitLifetime U>
117 if (byte_offset +
sizeof(U) *
count >
size()) {
123 template<concepts::ImplicitLifetime U>
129 template<concepts::ImplicitLifetime U>
136 T* m_data {
nullptr };
140template<
typename Iter,
typename SentOrSize>
143template<
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
constexpr auto span() const -> Span
Definition span_dynamic_size.h:73
constexpr Span(Iter iterator, types::size_t size)
Definition span_dynamic_size.h:40
constexpr auto data() const -> T *
Definition span_dynamic_size.h:70
auto typed_pointer(size_t byte_offset) const -> Optional< U const * >
Definition span_dynamic_size.h:86
constexpr Span(vocab::Array< U, size > &array)
Definition span_dynamic_size.h:51
auto typed_span_unchecked(size_t byte_offset, size_t count) const -> Span< U >
Definition span_dynamic_size.h:125
constexpr auto operator=(Span const &) -> Span &=default
constexpr Span(Span const &)=default
constexpr Span(Iter iterator, Sent sentinel)
Definition span_dynamic_size.h:45
constexpr Span(Con &&container)
Definition span_dynamic_size.h:61
T Value
Definition span_dynamic_size.h:33
constexpr Span(Span< U, other_extent > const &other)
Definition span_dynamic_size.h:64
auto typed_span_unchecked(size_t byte_offset, size_t count) const -> Span< U const >
Definition span_dynamic_size.h:131
auto typed_pointer_unchecked(size_t byte_offset) const -> U *
Definition span_dynamic_size.h:95
constexpr Span(T(&array)[size])
Definition span_dynamic_size.h:48
T ConstValue
Definition span_dynamic_size.h:34
constexpr auto size() const -> types::size_t
Definition span_dynamic_size.h:71
auto typed_pointer(size_t byte_offset) const -> Optional< U * >
Definition span_dynamic_size.h:77
auto typed_span(size_t byte_offset, size_t count) const -> Optional< Span< U const > >
Definition span_dynamic_size.h:116
constexpr Span(vocab::Array< U, size > const &array)
Definition span_dynamic_size.h:55
auto typed_span(size_t byte_offset, size_t count) const -> Optional< Span< U > >
Definition span_dynamic_size.h:107
auto typed_pointer_unchecked(size_t byte_offset) const -> U const *
Definition span_dynamic_size.h:101
Definition span_forward_declaration.h:10
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:62
constexpr auto count
Definition count.h:37