[#absl-MakeSpan-01]
= xref:absl.adoc[absl]::MakeSpan
:relfileprefix: ../
:mrdocs:

`MakeSpan` overloads

== Synopses

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

Constructs a mutable `Span` from a view container&period;


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

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

Constructs a mutable `Span` 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(absl&colon;&colon;MakeSpan(span&lowbar;internal&colon;&colon;GetData(c),
                                                c&period;size()))
xref:absl/MakeSpan-03.adoc[MakeSpan](C& c) noexcept
requires !span&lowbar;internal&colon;&colon;IsView&lt;C&gt;&colon;&colon;value;
----

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

Constructs a mutable `Span` 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(absl&colon;&colon;MakeSpan(span&lowbar;internal&colon;&colon;GetData(c),
                                                c&period;size()))
xref:absl/MakeSpan-09.adoc[MakeSpan](C& c) noexcept
requires !span&lowbar;internal&colon;&colon;IsView&lt;C&gt;&colon;&colon;value;
----

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

Constructs a mutable `Span&lt;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&gt;]
xref:absl/MakeSpan-0e2.adoc[MakeSpan](T(& array)[]) noexcept;
----

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

Constructs a mutable `Span&lt;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&gt;]
xref:absl/MakeSpan-0f.adoc[MakeSpan](
    T* begin,
    T* end) noexcept;
----

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

Constructs a mutable `Span&lt;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&gt;]
xref:absl/MakeSpan-0e4.adoc[MakeSpan](
    T* ptr,
    size&lowbar;t size) noexcept;
----

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

== Return Value

* A span over the elements of `c`&period;
* A span over all elements of `array`&period;
* A span over the range `&lsqb;begin, end)&rsqb;`&period;
* A 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]#
