[#absl-AnySpan-subspan]
= xref:absl.adoc[absl]::xref:absl/AnySpan.adoc[AnySpan]::subspan
:relfileprefix: ../../
:mrdocs:

Returns a subspan starting at `pos` and spanning `len` elements&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
xref:absl/AnySpan.adoc[AnySpan]
subspan(
    xref:absl/AnySpan/size_type.adoc[size&lowbar;type] pos,
    xref:absl/AnySpan/size_type.adoc[size&lowbar;type] len = npos) const;
----

== Description

`pos` must be `&lt;&equals; size()`&period; `len` must be `&lt;&equals; size() &hyphen; pos` or `npos`&semi; when `npos`, the subspan runs to the end&period; The container and transform must stay valid, though this span may become invalid before the subspan&period;

== Return Value

A span over the requested range&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *pos*
| Index of the first element of the subspan&period;
| *len*
| Number of elements in the subspan, or `npos` for the rest&period;
|===


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