MakeSpan overloads

Synopses

Declared in <absl/types/span.h>

Constructs a mutable Span from a view container.

template<
    int& ExplicitArgumentBarrier...,
    typename C>
constexpr
decltype(absl::MakeSpan(span_internal::GetData(c),
                                                c.size()))
MakeSpan(C& c) noexcept
requires span_internal::IsView<C>::value;

Constructs a mutable Span from a non‐view container.

template<
    int& ExplicitArgumentBarrier...,
    typename C>
constexpr
decltype(absl::MakeSpan(span_internal::GetData(c),
                                                c.size()))
MakeSpan(C& c) noexcept
requires !span_internal::IsView<C>::value;

Constructs a mutable Span from a non‐view container.

template<
    int& ExplicitArgumentBarrier...,
    typename C>
constexpr
decltype(absl::MakeSpan(span_internal::GetData(c),
                                                c.size()))
MakeSpan(C& c) noexcept
requires !span_internal::IsView<C>::value;

Constructs a mutable Span<T> from a C array.

template<
    int& ExplicitArgumentBarrier...,
    typename T,
    size_t N>
constexpr
Span<T>
MakeSpan(T(& array)[]) noexcept;

Constructs a mutable Span<T> from a [begin, end)] pointer pair.

template<
    int& ExplicitArgumentBarrier...,
    typename T>
Span<T>
MakeSpan(
    T* begin,
    T* end) noexcept;

Constructs a mutable Span<T> from a pointer and a size.

template<
    int& ExplicitArgumentBarrier...,
    typename T>
constexpr
Span<T>
MakeSpan(
    T* ptr,
    size_t size) noexcept;

Return Value

  • A span over the elements of c.

  • A span over all elements of array.

  • A span over the range [begin, end)].

  • A span over size elements starting at ptr.

Parameters

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.

Created with MrDocs