Constructs a span wrapping a const non‐view container (transform by ref).

Synopsis

Declared in <absl/types/any_span.h>

template<
    typename Container,
    typename Transform = any_span_transform::IdentityT,
    typename = EnableIfContainer<Container>,
    typename = EnableIfTransformIsValid<Transform, decltype(std::declval<const Container&>()[0])>,
    EnableIfTransformIsByRef<Transform> = true>
constexpr
AnySpan(
    Container const& container,
    Transform const& transform = any_span_transform::Identity());

Description

The transform, container, and its storage must outlive this span; reallocating or resizing the container invalidates the span.

Parameters

Name

Description

container

The container whose elements the span refers to.

transform

Functor applied to each element on access.

Created with MrDocs