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

Constructs a span wrapping a fixed&hyphen;size const array (transform by ref)&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 Element,
    xref:absl/AnySpan/size_type.adoc[size&lowbar;type] N,
    typename Transform = xref:absl/any_span_transform/IdentityT.adoc[any&lowbar;span&lowbar;transform::IdentityT],
    typename = xref:absl/AnySpan.adoc[EnableIfTransformIsValid&lt;Transform, Element const&&gt;],
    xref:absl/AnySpan.adoc[EnableIfTransformIsByRef&lt;Transform&gt;] = true&gt;
constexpr
AnySpan(
    Element const(& array)[],
    Transform const& transform = any&lowbar;span&lowbar;transform&colon;&colon;Identity());
----

== Description

The transform must be a function object whose const `operator()` takes an `Element` and returns a reference to `T` or a compatible object&period; Both the transform and array must outlive this span&period;

== Parameters

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


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