[#absl-MakeConstSpan-0ee] = xref:absl.adoc[absl]::MakeConstSpan :relfileprefix: ../ :mrdocs: `MakeConstSpan` overloads == Synopses Declared in `<absl/types/span.h>` Constructs a `Span<const T>` from a view container. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< int& ExplicitArgumentBarrier..., typename C> constexpr decltype(MakeSpan(c)) xref:absl/MakeConstSpan-0d.adoc[MakeConstSpan](C const& c) noexcept requires span_internal::IsView<C>::value; ---- [.small]#xref:absl/MakeConstSpan-0d.adoc[_» more..._]# Constructs a `Span<const T>` from a non‐view container. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< int& ExplicitArgumentBarrier..., typename C> constexpr decltype(MakeSpan(c)) xref:absl/MakeConstSpan-0c.adoc[MakeConstSpan](C const& c) noexcept requires !span_internal::IsView<C>::value; ---- [.small]#xref:absl/MakeConstSpan-0c.adoc[_» more..._]# Constructs a `Span<const T>` from a non‐view container. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< int& ExplicitArgumentBarrier..., typename C> constexpr decltype(MakeSpan(c)) xref:absl/MakeConstSpan-0ec.adoc[MakeConstSpan](C const& c) noexcept requires !span_internal::IsView<C>::value; ---- [.small]#xref:absl/MakeConstSpan-0ec.adoc[_» more..._]# Constructs a `Span<const T>` from a C array. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< int& ExplicitArgumentBarrier..., typename T, size_t N> constexpr xref:absl/Span.adoc[Span<T const>] xref:absl/MakeConstSpan-06.adoc[MakeConstSpan](T const(& array)[]) noexcept; ---- [.small]#xref:absl/MakeConstSpan-06.adoc[_» more..._]# Constructs a `Span<const T>` from a `[begin, end)]` pointer pair. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< int& ExplicitArgumentBarrier..., typename T> xref:absl/Span.adoc[Span<T const>] xref:absl/MakeConstSpan-07.adoc[MakeConstSpan]( T* begin, T* end) noexcept; ---- [.small]#xref:absl/MakeConstSpan-07.adoc[_» more..._]# Constructs a `Span<const T>` from a pointer and a size. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< int& ExplicitArgumentBarrier..., typename T> constexpr xref:absl/Span.adoc[Span<T const>] xref:absl/MakeConstSpan-05.adoc[MakeConstSpan]( T* ptr, size_t size) noexcept; ---- [.small]#xref:absl/MakeConstSpan-05.adoc[_» more..._]# == Return Value * A read‐only span over the elements of `c`. * A read‐only span over all elements of `array`. * A read‐only span over the range `[begin, end)]`. * A read‐only span over `size` elements starting at `ptr`. == Parameters [cols="1,4"] |=== | Name| Description | *c* | The container whose data the span refers to. | *array* | The array whose elements the span refers to. | *begin* | Pointer to the first element. | *end* | Pointer just past the last element. | *ptr* | Pointer to the first element. | *size* | Number of elements. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#