std:: is_unbounded_array
| Type traits | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Compile-time rational arithmetic | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Compile-time integer sequences | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
(C++14)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Défini dans l'en-tête
<type_traits>
|
||
|
template
<
class
T
>
struct is_unbounded_array ; |
(depuis C++20) | |
std::is_unbounded_array
est un
UnaryTypeTrait
.
Vérifie si
T
est un
tableau de taille inconnue
. Fournit la constante membre
value
qui est égale à
true
si
T
est un type tableau de taille inconnue. Sinon,
value
est égale à
false
.
Si le programme ajoute des spécialisations pour
std::is_unbounded_array
ou
std::is_unbounded_array_v
, le comportement est indéfini.
Sommaire |
Paramètres du modèle
| T | - | un type à vérifier |
Modèle de variable d'assistance
|
template
<
class
T
>
constexpr bool is_unbounded_array_v = is_unbounded_array < T > :: value ; |
(depuis C++20) | |
Hérité de std:: integral_constant
Constantes membres
|
value
[static]
|
true
si
T
est un type tableau de taille inconnue,
false
sinon
(constante membre publique statique) |
Fonctions membres
|
operator bool
|
convertit l'objet en
bool
, retourne
value
(fonction membre publique) |
|
operator()
(C++14)
|
retourne
value
(fonction membre publique) |
Types membres
| Type | Définition |
value_type
|
bool |
type
|
std:: integral_constant < bool , value > |
Implémentation possible
template<class T> struct is_unbounded_array: std::false_type {}; template<class T> struct is_unbounded_array<T[]> : std::true_type {}; |
Notes
| Macro de test de fonctionnalité | Valeur | Std | Fonctionnalité |
|---|---|---|---|
__cpp_lib_bounded_array_traits
|
201902L
|
(C++20) |
std::is_bounded_array
,
std::is_unbounded_array
|
Exemple
#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() {}
Voir aussi
|
(C++11)
|
vérifie si un type est un type tableau
(modèle de classe) |
|
(C++20)
|
vérifie si un type est un type tableau à taille fixe
(modèle de classe) |
|
(C++11)
|
obtient la taille d'un type tableau selon une dimension spécifiée
(modèle de classe) |