[#absl-MakeConstSpan-0ee]
= xref:absl.adoc[absl]::MakeConstSpan
:relfileprefix: ../
:mrdocs:

`MakeConstSpan` overloads

== Synopses

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

Constructs a `Span&lt;const T&gt;` from a view container&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    int& ExplicitArgumentBarrier&period;&period;&period;,
    typename C&gt;
constexpr
decltype(MakeSpan(c))
xref:absl/MakeConstSpan-0d.adoc[MakeConstSpan](C const& c) noexcept
requires span&lowbar;internal&colon;&colon;IsView&lt;C&gt;&colon;&colon;value;
----

[.small]#xref:absl/MakeConstSpan-0d.adoc[_» more&period;&period;&period;_]#

Constructs a `Span&lt;const T&gt;` from a non&hyphen;view container&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    int& ExplicitArgumentBarrier&period;&period;&period;,
    typename C&gt;
constexpr
decltype(MakeSpan(c))
xref:absl/MakeConstSpan-0c.adoc[MakeConstSpan](C const& c) noexcept
requires !span&lowbar;internal&colon;&colon;IsView&lt;C&gt;&colon;&colon;value;
----

[.small]#xref:absl/MakeConstSpan-0c.adoc[_» more&period;&period;&period;_]#

Constructs a `Span&lt;const T&gt;` from a non&hyphen;view container&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    int& ExplicitArgumentBarrier&period;&period;&period;,
    typename C&gt;
constexpr
decltype(MakeSpan(c))
xref:absl/MakeConstSpan-0ec.adoc[MakeConstSpan](C const& c) noexcept
requires !span&lowbar;internal&colon;&colon;IsView&lt;C&gt;&colon;&colon;value;
----

[.small]#xref:absl/MakeConstSpan-0ec.adoc[_» more&period;&period;&period;_]#

Constructs a `Span&lt;const T&gt;` from a C array&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    int& ExplicitArgumentBarrier&period;&period;&period;,
    typename T,
    size&lowbar;t N&gt;
constexpr
xref:absl/Span.adoc[Span&lt;T const&gt;]
xref:absl/MakeConstSpan-06.adoc[MakeConstSpan](T const(& array)[]) noexcept;
----

[.small]#xref:absl/MakeConstSpan-06.adoc[_» more&period;&period;&period;_]#

Constructs a `Span&lt;const T&gt;` from a `&lsqb;begin, end)&rsqb;` pointer pair&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    int& ExplicitArgumentBarrier&period;&period;&period;,
    typename T&gt;
xref:absl/Span.adoc[Span&lt;T const&gt;]
xref:absl/MakeConstSpan-07.adoc[MakeConstSpan](
    T* begin,
    T* end) noexcept;
----

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

Constructs a `Span&lt;const T&gt;` from a pointer and a size&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    int& ExplicitArgumentBarrier&period;&period;&period;,
    typename T&gt;
constexpr
xref:absl/Span.adoc[Span&lt;T const&gt;]
xref:absl/MakeConstSpan-05.adoc[MakeConstSpan](
    T* ptr,
    size&lowbar;t size) noexcept;
----

[.small]#xref:absl/MakeConstSpan-05.adoc[_» more&period;&period;&period;_]#

== Return Value

* A read&hyphen;only span over the elements of `c`&period;
* A read&hyphen;only span over all elements of `array`&period;
* A read&hyphen;only span over the range `&lsqb;begin, end)&rsqb;`&period;
* A read&hyphen;only span over `size` elements starting at `ptr`&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *c*
| The container whose data the span refers to&period;
| *array*
| The array whose elements the span refers to&period;
| *begin*
| Pointer to the first element&period;
| *end*
| Pointer just past the last element&period;
| *ptr*
| Pointer to the first element&period;
| *size*
| Number of elements&period;
|===


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