23 template <
typename ContiguousIterator>
25 : ptr_(&(*first)), n_(n) {}
26 template <
typename ContiguousIterator>
27 span(ContiguousIterator first, ContiguousIterator last)
28 : ptr_(&(*first)), n_(last - first) {}
43 constexpr
bool empty() const noexcept {
return n_ == 0; }
46 assert(offset + count <= n_);
47 return {ptr_ + offset, count};
span(ContiguousIterator first, size_type n)
Definition: span.hpp:24
T element_type
Definition: span.hpp:15
span(ContiguousIterator first, ContiguousIterator last)
Definition: span.hpp:27
std::remove_cv_t< T > value_type
Definition: span.hpp:16
T & reference
Definition: span.hpp:20
constexpr this_t subspan(size_type offset, size_type count) const
Definition: span.hpp:45
constexpr reference operator[](size_type i) const
Definition: span.hpp:38
span()
Definition: span.hpp:22
std::size_t size_type
Definition: span.hpp:17
constexpr pointer data() const noexcept
Definition: span.hpp:32
constexpr iterator end() const noexcept
Definition: span.hpp:36
constexpr reference back() const
Definition: span.hpp:41
constexpr bool empty() const noexcept
Definition: span.hpp:43
constexpr iterator begin() const noexcept
Definition: span.hpp:35
constexpr reference front() const
Definition: span.hpp:40
T * pointer
Definition: span.hpp:18
constexpr size_type size() const noexcept
Definition: span.hpp:33
pointer iterator
Definition: span.hpp:19
span(span< U > s)
Definition: span.hpp:30
Definition: allocator.hpp:16
constexpr auto end(const span< T > &s) noexcept
Definition: span.hpp:71
constexpr auto data(const span< T > &s) noexcept
Definition: span.hpp:56
constexpr auto size(const span< T > &s) noexcept
Definition: span.hpp:61
constexpr auto begin(const span< T > &s) noexcept
Definition: span.hpp:66