Espaces de noms
Variantes
Affichages
Actions

attribute specifier sequence (depuis C++11)

De cppreference.com
< cpp‎ | language

 
 
Langage C++
Sujets généraux
Contrôle de flux
Instructions conditionnelles
Instructions d'itération
Instructions de saut
Fonctions
déclaration de fonction
expression lambda
fonction générique
spécificateur inline
spécification d'exception (obsolète)
spécificateur noexcept (C++11)
Exceptions
Espaces de noms
Types
spécificateur decltype (C++11)
Qualificatifs
qualificatifs const et volatile
qualificatifs de stockage
qualificatif constexpr (C++11)
qualificatif auto (C++11)
qualificatif alignas (C++11)
Initialisation
Littéraux
Expressions
opérateurs alternatifs
Utilitaires
Types
déclaration typedef
déclaration d'alias de type (C++11)
attributs (C++11)
Jette
Original:
Casts
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
conversions implicites
conversion const_cast
conversion static_cast
conversion dynamic_cast
conversion reinterpret_cast
conversions style C et style fonction
Allocation de mémoire
Classes
Qualificatifs spécifiques aux membres de classe
Fonctions membres spéciales
Modèles
classes génériques
fonctions génériques
spécialisation de modèles
paquets de paramètres (C++11)
Divers
Assembleur
 
Introduit la mise en œuvre attributs définis pour les types, les objets, code, etc
Original:
Introduces implementation-defined attributes for types, objects, code, etc.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
[[attr]] [[attr1, attr2, attr3(args)]] [[namespace::attr(args)]] alignas_specifier

[modifier] Explication

Attributs fournissent la syntaxe standard unifié pour la mise en œuvre définies par les extensions de langage, comme le GNU et extensions de langage IBM __attribute__((...)), extension Microsoft __declspec(), etc
Original:
Attributes provide the unified standard syntax for implementation-defined language extensions, such as the GNU and IBM language extensions __attribute__((...)), Microsoft extension __declspec(), etc.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Un attribut peut être utilisé presque partout dans le programme C + +, et peut être appliqué à presque tout: les types, les variables, les fonctions, les noms, les blocs de code, aux unités de traduction entières, même si chaque attribut particulier est valable uniquement là où il est permise par la mise en œuvre: [[probably(true)]] ne peut être utilisé avec un if, et non pas avec une déclaration de classe. [[omp::parallel()]] peut s'appliquer à un bloc de code ou d'une boucle for, mais pas pour le type int, etc
Original:
An attribute can be used almost everywhere in the C++ program, and can be applied to almost everything: to types, to variables, to functions, to names, to code blocks, to entire translation units, although each particular attribute is only valid where it is permitted by the implementation: [[probably(true)]] can only be used with an if, and not with an class declaration. [[omp::parallel()]] can apply to a code block or to a for loop, but not to the type int, etc.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Dans des déclarations, des attributs peuvent apparaître à la fois avant et directement après le nom de l'entité qui est déclaré, auquel cas ils sont combinés. Dans la plupart des autres situations, les attributs s'appliquent à l'entité directement précédente .
Original:
In declarations, attributes may appear both before and directly after the name of the entity that is declared, in which case they are combined. In most other situations, attributes apply to the directly preceding entity.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
alignas_specifier est une partie de la séquence spécificateur d'attribut, même si elle a une syntaxe différente. Il peut apparaître lorsque les attributs [[...]] apparaissent et peuvent se mélanger avec eux (à condition qu'il soit utilisé là où alignas est autorisé)
Original:
alignas_specifier is a part of the attribute specifier sequence, although it has different syntax. It may appear where the [[...]] attributes appear and may mix with them (provided it is used where alignas is permitted)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier] Attributs standard

Seuls les deux attributs suivants sont définis par le standard C + +. Tous les autres attributs sont spécifiques à l'implémentation .
Original:
Only the following two attributes are defined by the C++ standard. All other attributes are implementation-specific.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
[[noreturn]]
Indique que la fonction ne retourne pas.
Cet attribut s'applique à fonctionner déclarations seulement. Le comportement est indéfini si la fonction de cet attribut retourne effectivement.
The suivantes fonctions standard ont cet attribut: std::_Exit, std::abort, std::exit, std::quick_exit, std::unexpected, std::terminate, std::rethrow_exception, std::throw_with_nested, std::rethrow_nested
Original:
Indicates that the function does not return.
This attribute applies to function declarations only. The behavior is undefined if the function with this attribute actually returns.
The following standard functions have this attribute: std::_Exit, std::abort, std::exit, std::quick_exit, std::unexpected, std::terminate, std::rethrow_exception, std::throw_with_nested, std::rethrow_nested
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
[[carries_dependency]]
Indique que la chaîne de dépendance dans le communiqué-consommer std::memory_order se propage dans et hors de la fonction, ce qui permet au compilateur d'ignorer inutile attribut instructions.
This mémoire barrière peut apparaître dans deux situations:

1) elle peut s'appliquer aux déclarations de paramètres d'une fonction ou lambda-expressions, dans ce cas, il indique que l'initialisation du paramètre de dépendance en porte-à-lvalue rvalue conversion de ce object.

2) Il peut demander à la déclaration de la fonction dans son ensemble, dans ce cas, il indique que la valeur de retour porte dépendance à l'évaluation de l'expression d'appel de fonction .
Original:
Indicates that dependency chain in release-consume std::memory_order propagates in and out of the function, which allows the compiler to skip unnecessary memory fence instructions.
This attribute may appear in two situations:

1) it may apply to the parameter declarations of a function or lambda-expressions, in which case it indicates that initialization of the parameter carries dependency into lvalue-to-rvalue conversion of that object.

2) It may apply to the function declaration as a whole, in which case it indicates that the return value carries dependency to the evaluation of the function call expression.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier] Exemple