absl::AnySpan::AnySpan

Constructs a span wrapping another span, applying a transform (by ref).

Synopsis

Declared in <absl/types/any_span.h>

template<
    typename Element,
    typename Transform,
    typename = EnableIfTransformIsValid<Transform, Element&>,
    EnableIfTransformIsByRef<Transform> = true>
constexpr
explicit
AnySpan(
    AnySpan<Element> const& other,
    Transform const& transform);

Description

Made explicit because it has lifetime consequences.

Parameters

NameDescription
otherThe source span to wrap.
transformFunctor applied to each element on access.