[#absl-AnySpan-2constructor-0d8] = xref:absl.adoc[absl]::xref:absl/AnySpan.adoc[AnySpan]::AnySpan :relfileprefix: ../../ :mrdocs: Constructs a span wrapping a const view container (transform by copy). == Synopsis Declared in `<absl/types/any_span.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Container, typename Transform, typename = xref:absl/AnySpan.adoc[EnableIfContainer<Container>], typename = xref:absl/AnySpan.adoc[EnableIfTransformIsValid<Transform, decltype(std::declval<const Container&>()[0])>], xref:absl/AnySpan.adoc[EnableIfTransformIsByCopy<Transform>] = true> constexpr AnySpan( Container const& container, Transform const& transform); ---- == Description Enabled even for mutable spans, since some views expose mutable element access when const. The transform, container, and its storage must outlive this span; reallocating or resizing the container invalidates the span. == Parameters [cols="1,4"] |=== | Name| Description | *container* | The container whose elements the span refers to. | *transform* | Functor applied to each element on access. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#