55 #ifndef ABSL_TYPES_SPAN_H_ 56 #define ABSL_TYPES_SPAN_H_ 61 #include <initializer_list> 63 #include <type_traits> 152 template <
typename T>
157 template <
typename C>
163 template <
typename U>
168 template <
typename U>
198 template <
typename V,
typename = EnableIfConvertibleFrom<V>,
199 typename = EnableIfMutableView<V>>
204 template <
typename V,
typename = EnableIfConvertibleFrom<V>,
205 typename = EnableIfConstView<V>>
244 template <
typename LazyT = T,
247 std::initializer_list<value_type>
v) noexcept
248 :
Span(
v.begin(),
v.size()) {}
271 constexpr
bool empty() const noexcept {
return size() == 0; }
278 return *(
data() +
i);
288 "Span::at failed bounds check"),
386 return (pos <=
size())
403 return (len <=
size())
420 return (len <=
size())
426 template <
typename H>
437 template <
typename T>
455 template <
typename T>
457 return span_internal::EqualImpl<Span, const T>(
a,
b);
459 template <
typename T>
461 return span_internal::EqualImpl<Span, const T>(
a,
b);
463 template <
typename T>
465 return span_internal::EqualImpl<Span, const T>(
a,
b);
468 typename T,
typename U,
471 return span_internal::EqualImpl<Span, const T>(
a,
b);
474 typename T,
typename U,
477 return span_internal::EqualImpl<Span, const T>(
a,
b);
481 template <
typename T>
485 template <
typename T>
489 template <
typename T>
494 typename T,
typename U,
500 typename T,
typename U,
507 template <
typename T>
509 return span_internal::LessThanImpl<Span, const T>(
a,
b);
511 template <
typename T>
512 bool operator<(Span<const T>
a,
Span<T> b) {
513 return span_internal::LessThanImpl<Span, const T>(
a,
b);
515 template <
typename T>
517 return span_internal::LessThanImpl<Span, const T>(
a,
b);
520 typename T,
typename U,
522 bool operator<(const U& a, Span<T>
b) {
523 return span_internal::LessThanImpl<Span, const T>(
a,
b);
526 typename T,
typename U,
528 bool operator<(Span<T>
a,
const U&
b) {
529 return span_internal::LessThanImpl<Span, const T>(
a,
b);
533 template <
typename T>
537 template <
typename T>
541 template <
typename T>
546 typename T,
typename U,
552 typename T,
typename U,
559 template <
typename T>
563 template <
typename T>
564 bool operator<=(Span<const T>
a,
Span<T> b) {
567 template <
typename T>
572 typename T,
typename U,
574 bool operator<=(const U& a, Span<T>
b) {
578 typename T,
typename U,
580 bool operator<=(Span<T>
a,
const U&
b) {
585 template <
typename T>
589 template <
typename T>
593 template <
typename T>
598 typename T,
typename U,
604 typename T,
typename U,
646 template <
int&... ExplicitArgumentBarrier,
typename T>
651 template <
int&... ExplicitArgumentBarrier,
typename T>
656 template <
int&... ExplicitArgumentBarrier,
typename C>
662 template <
int&... ExplicitArgumentBarrier,
typename T,
size_t N>
691 template <
int&... ExplicitArgumentBarrier,
typename T>
696 template <
int&... ExplicitArgumentBarrier,
typename T>
701 template <
int&... ExplicitArgumentBarrier,
typename C>
706 template <
int&... ExplicitArgumentBarrier,
typename T,
size_t N>
711 #endif // ABSL_TYPES_SPAN_H_
std::reverse_iterator< iterator > reverse_iterator
typename std::enable_if< span_internal::HasData< T, C >::value &&span_internal::HasSize< C >::value >::type EnableIfConvertibleFrom
constexpr const_iterator cbegin() const noexcept
const_pointer const_iterator
std::reverse_iterator< const_iterator > const_reverse_iterator
constexpr reverse_iterator rbegin() const noexcept
void ThrowStdOutOfRange(const std::string &what_arg)
void remove_prefix(size_type n) noexcept
constexpr Span subspan(size_type pos=0, size_type len=npos) const
#define ABSL_ASSERT(expr)
constexpr Span() noexcept
constexpr reverse_iterator rend() const noexcept
constexpr pointer data() const noexcept
friend H AbslHashValue(H h, Span v)
constexpr iterator end() const noexcept
constexpr bool empty() const noexcept
Span(std::initializer_list< value_type > v) noexcept
constexpr size_type length() const noexcept
typename std::remove_cv< T >::type remove_cv_t
constexpr reference at(size_type i) const
constexpr reference back() const noexcept
constexpr reference front() const noexcept
constexpr size_t Min(size_t a, size_t b) noexcept
constexpr size_type size() const noexcept
void remove_suffix(size_type n) noexcept
constexpr iterator begin() const noexcept
bool operator>(const absl::InlinedVector< T, N, A > &a, const absl::InlinedVector< T, N, A > &b)
ptrdiff_t difference_type
typename std::enable_if< std::is_const< T >::value, U >::type EnableIfConstView
constexpr Span last(size_type len) const
constexpr auto GetData(C &c) noexcept -> decltype(GetDataImpl(c, 0))
constexpr Span(const V &v) noexcept
bool operator==(const absl::InlinedVector< T, N, A > &a, const absl::InlinedVector< T, N, A > &b)
static const size_type npos
constexpr Span(T(&a)[N]) noexcept
constexpr reference operator[](size_type i) const noexcept
bool operator>=(const absl::InlinedVector< T, N, A > &a, const absl::InlinedVector< T, N, A > &b)
typename std::enable_if< IsConvertible< From, To >::value >::type EnableIfConvertibleTo
std::is_integral< absl::decay_t< decltype(std::declval< C & >().size())> > HasSize
bool operator!=(const absl::InlinedVector< T, N, A > &a, const absl::InlinedVector< T, N, A > &b)
const T & const_reference
constexpr const_reverse_iterator crend() const noexcept
constexpr Span(pointer array, size_type length) noexcept
constexpr Span< const T > MakeConstSpan(T *ptr, size_t size) noexcept
typename std::enable_if<!std::is_const< T >::value, U >::type EnableIfMutableView
#define ABSL_PREDICT_TRUE(x)
absl::remove_cv_t< T > value_type
constexpr Span< T > MakeSpan(T *ptr, size_t size) noexcept
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
constexpr const_reverse_iterator crbegin() const noexcept
constexpr Span first(size_type len) const
constexpr const_iterator cend() const noexcept