extent Class
Gets an array dimension.
Syntax
template <class Ty, unsigned I = 0>
struct extent;
Parameters
Ty
The type to query.
I
The array bound to query.
Remarks
If Ty is an array type that has at least I dimensions, the type query holds the number of elements in the dimension specified by I. If Ty is not an array type or its rank is less than I, or if I is zero and Ty is of type "array of unknown bound of U
", the type query holds the value 0.
Example
// std__type_traits__extent.cpp
// compile with: /EHsc
#include <type_traits>
#include <iostream>
int main()
{
std::cout << "extent 0 == "
<< std::extent<int[5][10]>::value << std::endl;
std::cout << "extent 1 == "
<< std::extent<int[5][10], 1>::value << std::endl;
return (0);
}
extent 0 == 5
extent 1 == 10
Requirements
Header: <type_traits>
Namespace: std
See also
Feedback
https://aka.ms/ContentUserFeedback.
În curând: Pe parcursul anului 2024, vom elimina treptat Probleme legate de GitHub ca mecanism de feedback pentru conținut și îl vom înlocui cu un nou sistem de feedback. Pentru mai multe informații, consultați:Trimiteți și vizualizați feedback pentru