std::tuple_size(std::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

value
[static]
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)
operator()
(C++14)
returns value
(public member function)

Member types

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

Example

See also

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

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
http://en.cppreference.com/w/cpp/container/span/tuple_size