std::tuple_size<std::array> - cppreference.com
From cppreference.com
|
|
(since C++11) | |
Provides access to the number of elements in an std::array as a compile-time constant expression.
Helper variable template
|
|
(since C++17) | |
Inherited from std::integral_constant
Member constants
N, the number of elements in the array (public static member constant) |
Member functions
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>
|
Example
#include <array> int main() { auto arr = std::to_array("ABBA"); static_assert(std::tuple_size<decltype(arr)>{} == 5); }