SysTutorials

Linux Manual Pages › Section 3

stdtuple_sizestdspan(3)

std::tuple_size(std::span) – std::tuple_size(std::span)

Synopsis

Defined in header <span>
template< class T, std::size_t N >
class tuple_size< std::span<T, N> > : (1) (since C++20)
public std::integral_constant<std::size_t, N>
{ };
template< class T > (2) (since C++20)
class tuple_size< std::span<T, std::dynamic_extent> >; // Not defined
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 N, the number of elements in the span
         (public static member constant)
[static]

Member functions

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

operator() returns value
                     (public member function)
(C++14)

Member types

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

Example

 This section is incomplete
 Reason: no example

See also

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