[#absl-Span-2constructor-0a1]
= xref:absl.adoc[absl]::xref:absl/Span.adoc[Span]::Span
:relfileprefix: ../../
:mrdocs:

Constructors

== Synopses

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

Constructs an empty span&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
xref:absl/Span/2constructor-062.adoc[Span]() noexcept;
----

[.small]#xref:absl/Span/2constructor-062.adoc[_» more&period;&period;&period;_]#

Constructs a span referring to a C array&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;size&lowbar;t N&gt;
constexpr
xref:absl/Span/2constructor-06a.adoc[Span](T(& a)[]) noexcept;
----

[.small]#xref:absl/Span/2constructor-06a.adoc[_» more&period;&period;&period;_]#

Constructs a read&hyphen;only span from an initializer list&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename LazyT = T,
    typename = LazyT&gt;
xref:absl/Span/2constructor-08.adoc[Span](std::initializer&lowbar;list&lt;value&lowbar;type&gt; v) noexcept;
----

[.small]#xref:absl/Span/2constructor-08.adoc[_» more&period;&period;&period;_]#

Constructs a mutable span from a container&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename V,
    typename = xref:absl/Span.adoc[EnableIfConvertibleFrom&lt;V&gt;],
    typename = V,
    typename = span&lowbar;internal::EnableIfNotIsView&lt;V&gt;&gt;
explicit
xref:absl/Span/2constructor-0a2.adoc[Span](V& v) noexcept;
----

[.small]#xref:absl/Span/2constructor-0a2.adoc[_» more&period;&period;&period;_]#

Constructs a mutable span from a view type (no lifetime bound)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename V,
    typename = xref:absl/Span.adoc[EnableIfConvertibleFrom&lt;V&gt;],
    typename = V,
    span&lowbar;internal::EnableIfIsView&lt;V&gt; = 0&gt;
explicit
xref:absl/Span/2constructor-04.adoc[Span](V& v) noexcept;
----

[.small]#xref:absl/Span/2constructor-04.adoc[_» more&period;&period;&period;_]#

Constructs a read&hyphen;only `Span&lt;const T&gt;` from a container&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename V,
    typename = xref:absl/Span.adoc[EnableIfConvertibleFrom&lt;V&gt;],
    typename = V,
    typename = span&lowbar;internal::EnableIfNotIsView&lt;V&gt;&gt;
constexpr
xref:absl/Span/2constructor-09.adoc[Span](V const& v) noexcept;
----

[.small]#xref:absl/Span/2constructor-09.adoc[_» more&period;&period;&period;_]#

Constructs a read&hyphen;only span from a view type (no lifetime bound)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename V,
    typename = xref:absl/Span.adoc[EnableIfConvertibleFrom&lt;V&gt;],
    typename = V,
    span&lowbar;internal::EnableIfIsView&lt;V&gt; = 0&gt;
constexpr
xref:absl/Span/2constructor-07.adoc[Span](V const& v) noexcept;
----

[.small]#xref:absl/Span/2constructor-07.adoc[_» more&period;&period;&period;_]#

Constructs a span from a pointer and a length&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
xref:absl/Span/2constructor-00.adoc[Span](
    xref:absl/Span/pointer.adoc[pointer] array,
    xref:absl/Span/size_type.adoc[size&lowbar;type] length) noexcept;
----

[.small]#xref:absl/Span/2constructor-00.adoc[_» more&period;&period;&period;_]#

== Parameters

[cols="1,4"]
|===
| Name| Description
| *a*
| The array to refer to&period;
| *v*
| The initializer list whose data the span refers to&period;
| *array*
| Pointer to the first element&period;
| *length*
| Number of elements in the span&period;
|===


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