attribute specifier sequence(dal C++11) - cppreference.com
Da cppreference.com.
|
|
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate. La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
<metanoindex/>
Introduce attuazione attributi definiti per i tipi, oggetti, codici, ecc
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
Spiegazione
Gli attributi forniscono la sintassi standard unificato per l'attuazione definite le estensioni del linguaggio, come la GNU e le estensioni del linguaggio IBM __attribute__((...)), estensione Microsoft __declspec(), ecc
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 attributo può essere utilizzato in quasi tutto il programma C + +, e può essere applicato a quasi tutto: ai tipi, alle variabili, alle funzioni, ai nomi, ai blocchi di codice, per unità di traduzione intere, anche se ogni particolare attributo è valido solo qualora è consentita dalla implementazione: [[probably(true)]] può essere utilizzato solo con un if, e non con una dichiarazione di classe. [[omp::parallel()]] può applicare a un blocco di codice o di un ciclo for, ma non al tipo int, ecc
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.
In dichiarazioni, gli attributi possono apparire sia prima e subito dopo il nome del soggetto che viene dichiarato, nel qual caso essi sono combinati. Nella maggior parte delle altre situazioni, gli attributi si applicano alla società direttamente precedente.
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 è una parte della sequenza identificatore di attributo, anche se ha una sintassi diversa. Può apparire, dove gli attributi [[...]] appaiono e può mescolare con loro (a condizione che sia utilizzato dove alignas è consentito)
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.
Attributi standard
Solo i seguenti due attributi sono definiti dal C + + standard. Tutti gli altri attributi sono l'attuazione specifica.
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]]
|
Indica che la funzione non restituisce. Original: Indicates that the function does not return. The text has been machine-translated via Google Translate. |
[[carries_dependency]]
|
Indica che la catena di dipendenza nel comunicato-consumare std::memory_order propaga dentro e fuori della funzione, che consente al compilatore di saltare inutili recinzione attributo memoria instructions. 1) si può applicare alle dichiarazioni di parametri di una funzione o lambda-espressioni, nel qual caso esso indica che l'inizializzazione del parametro porta in dipendenza lvalue a rvalue conversione che object. 2) Si può applicare alla dichiarazione di funzione come un tutto, nel qual caso esso indica che il valore di ritorno porta dipendenza alla valutazione dell'espressione chiamata di funzione . 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. 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. |