[#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. == Synopsis Declared in `<absl/types/any_span.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr xref:absl/AnySpan.adoc[AnySpan] subspan( xref:absl/AnySpan/size_type.adoc[size_type] pos, xref:absl/AnySpan/size_type.adoc[size_type] len = npos) const; ---- == Description `pos` must be `<= size()`. `len` must be `<= size() ‐ pos` or `npos`; when `npos`, the subspan runs to the end. The container and transform must stay valid, though this span may become invalid before the subspan. == Return Value A span over the requested range. == Parameters [cols="1,4"] |=== | Name| Description | *pos* | Index of the first element of the subspan. | *len* | Number of elements in the subspan, or `npos` for the rest. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#