[#absl-AnySpan-2constructor-023]
= xref:absl.adoc[absl]::xref:absl/AnySpan.adoc[AnySpan]::AnySpan
:relfileprefix: ../../
:mrdocs:

Constructs a span wrapping a const non&hyphen;view container (transform by copy)&period;

== Synopsis

Declared in `&lt;absl&sol;types&sol;any&lowbar;span&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename Container,
    typename Transform,
    typename = xref:absl/AnySpan.adoc[EnableIfContainer&lt;Container&gt;],
    typename = xref:absl/AnySpan.adoc[EnableIfTransformIsValid&lt;Transform, decltype(std&colon;&colon;declval&lt;const Container&amp;&gt;()&lsqb;0&rsqb;)&gt;],
    xref:absl/AnySpan.adoc[EnableIfTransformIsByCopy&lt;Transform&gt;] = true&gt;
constexpr
AnySpan(
    Container const& container,
    Transform const& transform);
----

== Description

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

== Parameters

[cols="1,4"]
|===
| Name| Description
| *container*
| The container whose elements the span refers to&period;
| *transform*
| Functor applied to each element on access&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
