attribute specifier sequence(seit C++11)
Aus cppreference.com
[] |
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
<metanoindex/>
Stellt die Implementierung definiert Attribute fr Typen, Objekte, 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.
You can help to correct and verify the translation. Click here for instructions.
[[attr]][[attr1, attr2, attr3(args)]][[namespace::attr(args)]]alignas_specifier
Erklrung
Attribute bilden die einheitlichen Standard Syntax fr die Implementierung definiert Spracherweiterungen, wie die GNU und IBM Spracherweiterungen
__attribute__((...)), Microsoft-Erweiterung __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.
You can help to correct and verify the translation. Click here for instructions.
Ein Attribut kann fast berall in der C + +-Programm verwendet werden, und kann auf fast alles angewandt werden: die Typen, Variablen, Funktionen, um Namen, um Code-Blcke, die gesamte bersetzung Einheiten, obwohl jedes einzelne Attribut ist nur gltig, wenn es wird durch die Implementierung erlaubt:
[[probably(true)]] kann nur mit einem if verwendet werden, und nicht mit einer Klassendeklaration. [[omp::parallel()]] kann zu einem Code zu einem Block oder for Schleife gelten, aber nicht mit dem Typ 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.
You can help to correct and verify the translation. Click here for instructions.
In Erklrungen, knnen Attribute sowohl vor als auch unmittelbar nach dem Namen des Unternehmens, das erklrt, in welchem Fall sie kombiniert werden angezeigt. In den meisten anderen Situationen, Attribute zu dem direkt vorausfahrenden Einheit gelten .
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.
You can help to correct and verify the translation. Click here for instructions.
alignas_specifier ist ein Teil des Attributs Spezifizierer Sequenz, obwohl es andere Syntax hat. Es kann vorkommen, wo die
[[...]] Attribute und erscheinen mag mit ihnen (vorausgesetzt, es wird dort eingesetzt, wo alignas zulssig ist) mischenOriginal:
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.
You can help to correct and verify the translation. Click here for instructions.
Standard-Attribute
Nur die folgenden beiden Attribute werden von der C + +-Standard definiert. Alle anderen Attribute sind die Implementierung spezifischer .
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.
You can help to correct and verify the translation. Click here for instructions.
[[noreturn]]
|
Zeigt an, dass die Funktion nicht zurck.
Dieses Attribut gilt fr Erklrungen nur dann funktionieren. Das Verhalten ist undefiniert, wenn die Funktion mit diesem Attribut tatschlich zurckgibt. The folgenden Standard-Funktionen besitzen dieses 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]]
|
std::memory_order: Zeigt an, dass die Abhngigkeit Kette release-verbrauchen
breitet sich in und aus der Funktion, die der Compiler unntigen Speicherplatz Zaun instructions. This Attribut berspringen kann in zwei Situationen auftreten 1) es kann mit den Parameterdeklarationen einer Funktion oder Lambda-Ausdrcke gelten, in dem Fall zeigt, dass die Initialisierung des Parameters trgt Abhngigkeit in Lvalue-zu-R-Wert-Umwandlung dieses object. 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. The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Beispiel
| This section is incomplete Reason: no example |