A type‐erased, non‐owning view over a random‐access sequence.
Synopsis
Declared in <absl/types/any_span.h>
template<typename T>
class AnySpan;
Description
Like absl::Span, an AnySpan refers to elements owned elsewhere, but it can wrap any container, array, or view of a compatible element type and can apply a transform to each element on access. It must not outlive the data, transform, or container it refers to.
Types
Name |
Description |
Random‐access iterator over the const elements of an |
|
Random‐access iterator over the elements of an |
Type Aliases
Name |
Description |
Tag marking |
|
A pointer to a const element. |
|
A reference to a const element. |
|
A reverse iterator over const elements. |
|
A signed type used for iterator differences. |
|
The element type, including any const‐qualification. |
|
A pointer to an element. |
|
A reference to an element. |
|
A reverse iterator over the elements. |
|
An unsigned type used for sizes and indices. |
|
The element type with const removed. |
Member Functions
Name |
Description |
|
Constructors |
Returns a reference to the element at |
|
Returns a reference to the last element; the span must not be empty. |
|
Returns an iterator to the first element. |
|
Returns a const iterator to the first element. |
|
Returns a const iterator just past the last element. |
|
Returns a const reverse iterator to the last element. |
|
Returns a const reverse iterator just before the first element. |
|
Reports whether this span is empty. |
|
Returns an iterator just past the last element. |
|
Returns a span containing the first |
|
Returns a reference to the first element; the span must not be empty. |
|
Returns a span containing the last |
|
Returns a reference to the element at |
|
Returns a reverse iterator to the last element. |
|
Returns a reverse iterator just before the first element. |
|
Returns the number of elements in this span. |
|
Returns a subspan starting at |
Static Data Members
Name |
Description |
Sentinel size value meaning "until the end of the span". |
Friends
Name |
Description |
Compares two spans for inequality. |
|
Compares two spans for element‐wise equality. |
|
Compares two const spans for inequality. |
|
Compares two const spans for element‐wise equality. |
|
|
A type‐erased, non‐owning view over a random‐access sequence. |
Hashes the span's elements for use with |
Non-Member Functions
Name |
Description |
Constructs an |
|
Constructs an |
|
Constructs an |
|
Constructs a const |
|
Constructs a const |
|
Constructs a const |
|
Constructs a const |
|
Constructs a const |
|
Constructs an |
|
Constructs an |
Created with MrDocs