absl::MakeConstAnySpan

MakeConstAnySpan overloads

Synopses

Declared in <absl/types/any_span.h>

Constructs a const AnySpan from a view container or array.

template<
    int& ExplicitArgumentBarrier...,
    typename Container,
    typename T = any_span_internal::ElementType<Container const>>
AnySpan<T const>
MakeConstAnySpan(Container const& c)
requires absl::type_traits_internal::IsView<Container>::value;
» more...

Constructs a const AnySpan from a non-view container or array.

template<
    int& ExplicitArgumentBarrier...,
    typename Container,
    typename T = any_span_internal::ElementType<Container const>>
AnySpan<T const>
MakeConstAnySpan(Container const& c)
requires !absl::type_traits_internal::IsView<Container>::value;
» more...

Constructs a const AnySpan from a pointer and a size.

template<
    int& ExplicitArgumentBarrier...,
    typename T>
AnySpan<T const>
MakeConstAnySpan(
    T const* ptr,
    std::size_t size);
» more...

Return Value

  • A read-only AnySpan over the elements of c.
  • A read-only AnySpan over size elements starting at ptr.

Parameters

NameDescription
cThe container whose elements the span refers to.
ptrPointer to the first element.
sizeNumber of elements.