< cpp‎ | container‎ | span
Defined in header <span>
template< class T, std::size_t N >

class tuple_size< std::span<T, N> > :
    public std::integral_constant<std::size_t, N>

{ };
(1) (since C++20)
template< class T >
class tuple_size< std::span<T, std::dynamic_extent> >; // Not defined
(2) (since C++20)

Provides access to the number of elements in a static-extent span as a compile-time constant expression. If the span has dynamic extent, the tuple_size specialization is an incomplete type.

Inherited from std::integral_constant

Member constants

N, the number of elements in the span
(public static member constant)

Member functions

operator std::size_t
converts the object to std::size_t, returns value
(public member function)
returns value
(public member function)

Member types

Type Definition
value_type std::size_t
type std::integral_constant<std::size_t, value>


See also

obtains the size of tuple at compile time
(class template specialization)