std:: is_unbounded_array
| Type traits | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Compile-time rational arithmetic | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Compile-time integer sequences | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
(C++14)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Definido en el encabezado
<type_traits>
|
||
|
template
<
class
T
>
struct is_unbounded_array ; |
(desde C++20) | |
std::is_unbounded_array
es un
UnaryTypeTrait
.
Comprueba si
T
es un
array de límite desconocido
. Proporciona la constante miembro
value
que es igual a
true
, si
T
es un tipo array de límite desconocido. De lo contrario,
value
es igual a
false
.
Si el programa añade especializaciones para
std::is_unbounded_array
o
std::is_unbounded_array_v
, el comportamiento es indefinido.
Contenidos |
Parámetros de plantilla
| T | - | un tipo a verificar |
Plantilla de variable auxiliar
|
template
<
class
T
>
constexpr bool is_unbounded_array_v = is_unbounded_array < T > :: value ; |
(desde C++20) | |
Heredado de std:: integral_constant
Constantes miembro
|
value
[static]
|
true
si
T
es un tipo array de límite desconocido,
false
en caso contrario
(constante miembro pública estática) |
Funciones miembro
|
operator bool
|
convierte el objeto a
bool
, devuelve
value
(función miembro pública) |
|
operator()
(C++14)
|
devuelve
value
(función miembro pública) |
Tipos miembro
| Tipo | Definición |
value_type
|
bool |
type
|
std:: integral_constant < bool , value > |
Implementación posible
template<class T> struct is_unbounded_array: std::false_type {}; template<class T> struct is_unbounded_array<T[]> : std::true_type {}; |
Notas
| Macro de prueba de características | Valor | Estándar | Característica |
|---|---|---|---|
__cpp_lib_bounded_array_traits
|
201902L
|
(C++20) |
std::is_bounded_array
,
std::is_unbounded_array
|
Ejemplo
#include <type_traits> class A {}; static_assert ("" && std::is_unbounded_array_v<A> == false && std::is_unbounded_array_v<A[]> == true && std::is_unbounded_array_v<A[3]> == false && std::is_unbounded_array_v<float> == false && std::is_unbounded_array_v<int> == false && std::is_unbounded_array_v<int[]> == true && std::is_unbounded_array_v<int[3]> == false ); int main() {}
Véase también
|
(C++11)
|
comprueba si un tipo es un tipo de arreglo
(plantilla de clase) |
|
(C++20)
|
comprueba si un tipo es un tipo de arreglo con límite conocido
(plantilla de clase) |
|
(C++11)
|
obtiene el tamaño de un tipo de arreglo a lo largo de una dimensión especificada
(plantilla de clase) |