 |
ATLAS Offline Software
|
Go to the documentation of this file.
13 #ifndef CXXUTILS_SPAN_H
14 #define CXXUTILS_SPAN_H
19 #include <type_traits>
35 template <
class T,
class U>
60 :
public std::ranges::view_base
343 #endif // not CXXUTILS_SPAN_H
span(T *ptr, std::size_t sz) -> span< T >
A couple needed deduction guides.
constexpr iterator begin() noexcept
Return a begin iterator.
constexpr bool empty() const noexcept
Test if the span is empty.
constexpr span last(size_type n) noexcept
Return a subspan from the end.
bool const RAWDATA *ch2 const
std::reverse_iterator< iterator > reverse_iterator
constexpr size_type size() const noexcept
Return the size of the span.
Simplified version of the C++20 std::span.
requires(valid_span_type_v< T, U >) span(U *ptr
Constructor from start and length.
constexpr reference front() noexcept
Return a reference to the first element in the span.
constexpr pointer data() noexcept
Return a pointer to the start of the span.
constexpr reverse_iterator rbegin() noexcept
Return a begin reverse iterator.
const element_type & const_reference
constexpr size_t dynamic_extent
Used to specify a subrange of indefinite size in subspan().
constexpr span subspan(size_type offs, size_type n=dynamic_extent) noexcept
Return a subspan.
constexpr reference at(size_type i)
Return a reference to the i-th element in the span (bounds-checked).
constexpr reference back() noexcept
Return a reference to the last element in the span.
concept IsContiguousContainer
size_t m_size
Number of elements in the span.
constexpr size_type size_bytes() const noexcept
Return the size of contents of the span, in bytes.
T * m_ptr
Pointer to the start of the span.
A couple standard-library related concepts.
std::ptrdiff_t difference_type
T element_type
Required typedefs.
constexpr span first(size_type n) noexcept
Return a subspan from the start.
constexpr reverse_iterator rend() noexcept
Return an end reverse iterator.
const_pointer const_iterator
constexpr bool valid_span_type_v
Is U* a valid type to use to initialize a span<T>? No more than const-conversion.
auto make_span(CONTAINER &c)
Helper to make a span from a container.
std::reverse_iterator< const_iterator > const_reverse_iterator