absl::AnySpan::AnySpan

Constructs a span wrapping an initializer list, applying a transform.

Synopsis

Declared in <absl/types/any_span.h>

template<
    typename Element,
    typename Transform,
    typename = EnableIfTransformIsValid<Transform, Element const&>,
    EnableIfTransformIsByCopy<Transform> = true>
constexpr
AnySpan(
    std::initializer_list<Element> l,
    Transform const& transform);

Description

Useful for a list of a type other than value_type. The transform is taken by copy. The initializer list must outlive this span.

Parameters

NameDescription
lThe initializer list whose elements the span refers to.
transformFunctor applied to each element on access.