constexpr specifier (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/>
constexpr- bedeutet, der Wert eines Ausdrucks kann zur Übersetzungszeit berechnet werden.Original:constexpr- specifies that the value of a variable or function can be computed at compile timeThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Erklärung
constexpr Spezifizierer legt fest, dass es möglich sein muss, den Wert des Ausdrucks zur Übersetzungszeit zu berechnen. Der Ausdruck kann dann dort verwendet werden, wo nur zur Kompilierungszeit konstante Ausdrücke erlaubt sind. constexpr bedeutet const .Original:
constexpr specifier declares that it is possible to evaluate the value of the function or variable at compile time, they then can be used where only compile time konstante Ausdrücke are allowed. constexpr implies const.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.
'
constexpr Variablen' muss die folgenden Anforderungen erfüllen:Original:
constexpr variables must satisfy the following requirements: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.
- Es muss sofort gebaut werden oder ein Wert zugewiesen .Original:it must be immediately constructed or assigned a value.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - der Konstruktor Parameter oder der Wert zugewiesen werden darf nur literalen Werten,
constexprVariablen und Funktionen .Original:the constructor parameters or the value to be assigned must contain only literal values,constexprvariables and functions.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - der Konstruktor verwendet, um das Objekt (entweder implizit oder explizit) konstruieren müssen den Anforderungen der
constexprKonstruktor. Im Falle der expliziten Konstruktor, muss esconstexprangegeben haben .Original:the constructor used to construct the object (either implicit or explicit) must satisfy the requirements ofconstexprconstructor. In the case of explicit constructor, it must haveconstexprspecified.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
'
constexpr Funktionen' muss die folgenden Anforderungen erfüllen:Original:
constexpr functions must satisfy the following requirements: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.
- es darf nicht virtuellOriginal:it must not be virtualThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - seine Rückkehr Typ muss
LiteralTypeseinOriginal:its return type must beLiteralTypeThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - jeder seiner Parameter müssen wörtliche Typ seinOriginal:each of its parameters must be literal typeThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - die Funktion Körper muss entweder gelöscht oder ausgefallen oder enthalten nur die folgenden:Original:the function body must be either deleted or defaulted or contain only the following:The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
- null AussagenOriginal:null statementsThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. static_assertErklärungenOriginal:static_assertdeclarationsThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.typedefErklärungen und Alias Erklärungen, die nicht definieren Klassen oder AufzählungenOriginal:The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.- mit ErklärungenOriginal:using declarationsThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - using-DirektivenOriginal:using directivesThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - genau ein
returnAnweisung, die nur literalen Werten,constexprVariablen und Funktionen enthält .Original:exactly onereturnstatement that contains only literal values,constexprvariables and functions.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
'
constexpr Konstruktor' muss folgenden Anforderungen genügen:Original:
constexpr constructor must satisfy the following requirements: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.
- jeder seiner Parameter müssen wörtliche Typ seinOriginal:each of its parameters must be literal typeThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - Die Klasse muss keine virtuellen BasisklassenOriginal:the class must have no virtual base classesThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - der Konstruktor Körper muss entweder gelöscht oder ausgefallen oder enthalten nur die folgenden:Original:the constructor body must be either deleted or defaulted or contain only the following:The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
- null AussagenOriginal:null statementsThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. static_assertErklärungenOriginal:static_assertdeclarationsThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.