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;

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;

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);

Return Value

  • A read‐only AnySpan over the elements of c.

  • A read‐only AnySpan over size elements starting at ptr.

Parameters

Name

Description

c

The container whose elements the span refers to.

ptr

Pointer to the first element.

size

Number of elements.

Created with MrDocs