# std::tuple_size(std::span)

From cppreference.com
< 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

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

| This section is incomplete Reason: no example

### See also

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

Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/container/span/tuple_size&oldid=110731"