Namensräume
Varianten
Aktionen

Storage duration specifiers

Aus cppreference.com
< cpp‎ | language

 
 
Sprache C + +
Allgemeine Themen
Original:
General topics
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Flusskontrolle
Original:
Flow control
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Bedingte Ausführung Aussagen
Original:
Conditional execution statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Iterationsanweisungen
Original:
Iteration statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Gehe Aussagen
Original:
Jump statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Funktionen
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Funktion Erklärung
Lambda-Funktion Erklärung
Funktions-Template
inline-Spezifizierer
Exception-Spezifikationen (veraltet)
noexcept Spezifizierer (C++11)
Ausnahmen
Original:
Exceptions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Namespaces
Original:
Namespaces
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Types
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
decltype specifier (C++11)
Specifiers
Original:
Specifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
cv Planer
Lagerdauer Planer
constexpr Spezifizierer (C++11)
auto Spezifizierer (C++11)
alignas Spezifizierer (C++11)
Initialisierung
Original:
Initialization
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Literale
Original:
Literals
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Expressions
Original:
Expressions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
alternative Darstellungen
Utilities
Original:
Utilities
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Types
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
typedef declaration
Typ Aliasdeklaration (C++11)
Attribute (C++11)
Wirft
Original:
Casts
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
impliziten Konvertierungen
const_cast conversion
static_cast conversion
dynamic_cast conversion
reinterpret_cast conversion
C-Stil und funktionale Besetzung
Speicherzuweisung
Original:
Memory allocation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Classes
Original:
Classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Class-spezifische Funktion Eigenschaften
Original:
Class-specific function properties
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
explizit (C++11)
statisch
Besondere Member-Funktionen
Original:
Special member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Templates
Original:
Templates
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Klassen-Template
Funktions-Template
Template-Spezialisierung
Parameter Packs (C++11)
Verschiedenes
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Inline Montage
 
  • auto - automatische Lagerdauer. (veraltet)
    Original:
    auto - automatic storage duration. (veraltet)
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • register - automatische Lagerdauer. Auch Hinweise für den Compiler, um die Variable in der Prozessor-Register platzieren. (veraltet)
    Original:
    register - automatic storage duration. Also hints to the compiler to place the variable in the processor's register. (veraltet)
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • static - statische Lagerdauer und intern Verknüpfung
    Original:
    static - static storage duration and internal linkage
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • extern - statische Lagerdauer und außen Verknüpfung
    Original:
    extern - static storage duration and external linkage
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • thread_local - Gewinde Lagerdauer. (seit C++11)
    Original:
    thread_local - thread storage duration. (seit C++11)
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.

Inhaltsverzeichnis

[Bearbeiten] Erklärung

[Bearbeiten] Lagerdauer

Alle Variablen in einem Programm eine der folgenden Speicher-Laufzeiten:
Original:
All variables in a program have one of the following storage durations:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
  • ' 'Automatische Lagerdauer. Die Variable wird zu Beginn des einschließenden Codeblock reserviert und freigegeben am Ende. Alle nicht-globalen Variablen haben dieses Lagerdauer, mit Ausnahme deklariert static, extern oder thread_local .
    Original:
    automatic storage duration. The variable is allocated at the beginning of the enclosing code block and deallocated on end. All non-global variables have this storage duration, except those declared static, extern or thread_local.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • ' 'Static Lagerdauer. Die Variable zugeordnet wird, wenn das Programm beginnt und freigegeben, wenn das Programm beendet. Nur eine Instanz der Variable existiert. Alle globalen Variablen haben diese Lagerdauer, plus diejenigen, erklärte mit static oder extern .
    Original:
    static storage duration. The variable is allocated when the program begins and deallocated when the program ends. Only one instance of the variable exists. All global variables have this storage duration, plus those declared with static or extern.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • ' 'Thread Lagerdauer (seit C++11). Die Variable zugeordnet wird, wenn der Faden beginnt und freigegeben, wenn der Thread beendet. Jeder Thread hat eine eigene Instanz der Variable. Nur Variablen deklariert thread_local haben diese Lagerdauer. thread_local kann nur für globale Variablen deklariert werden, plus die deklarierte static oder extern .
    Original:
    thread storage duration (seit C++11). The variable is allocated when the thread begins and deallocated when the thread ends. Each thread has its own instance of the variable. Only variables declared thread_local have this storage duration. thread_local can only be declared for global variables, plus those declared with static or extern.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • ' 'Dynamic Lagerdauer. Die Variable wird reserviert und freigegeben pro Anforderung mithilfe dynamische Speicherverwaltung Funktionen .
    Original:
    dynamic storage duration. The variable is allocated and deallocated per request by using dynamische Speicherverwaltung functions.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.

[Bearbeiten] Linkage

Bindung bezieht sich auf die Fähigkeit einer Variable oder Funktion in anderen Bereichen bezeichnet. Wenn eine Variable oder Funktion mit dem gleichen Bezeichner in mehreren Bereichen deklariert wird, aber nicht, um aus allen von ihnen bezeichnet werden, werden dann mehrere Instanzen des variablen erzeugt. Die folgenden Verbindungen werden erkannt:
Original:
Linkage refers to the ability of a variable or function to be referred to in other scopes. If a variable or function with the same identifier is declared in several scopes, but cannot be referred to from all of them, then several instances of the variable are generated. The following linkages are recognized:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
  • ' 'Keine Verknüpfung. Die Variable kann nur vom Umfang bezeichnet ist es in. Alle Variablen mit automatischer, Faden und dynamischen Speichermodul Dauern haben diese Bindung .
    Original:
    no linkage. The variable can be referred to only from the scope it is in. All variables with automatic, thread and dynamic storage durations have this linkage.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • ' 'Interne Bindung. Die Variable kann von allen Bereiche in der aktuellen Übersetzungseinheit bezeichnet werden. Alle Variablen mit statischen Lagerdauer, die entweder deklariert werden static oder const aber nicht extern haben diese Verbindung .
    Original:
    internal linkage. The variable can be referred to from all scopes in the current translation unit. All variables with static storage duration which are either declared static, or const but not extern, have this linkage.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • ' 'Externe Bindung. Die Variable kann aus den Bereichen in den anderen Übersetzungseinheiten bezeichnet werden. Alle Variablen mit statischen Lagerdauer haben diese Verknüpfung, mit Ausnahme derjenigen, erklärte static oder const aber nicht extern .
    Original:
    external linkage. The variable can be referred to from the scopes in the other translation units. All variables with static storage duration have this linkage, except those declared static, or const but not extern.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.

[Bearbeiten] Keywords

auto, register, static, extern, thread_local

[Bearbeiten] Beispiel