Espacios de nombres
Variantes
Acciones

Storage duration specifiers

De cppreference.com
< cpp‎ | language

 
 
Lenguaje C++
Los temas generales
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.
Control de flujo
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.
Sentencias condicionales ejecución
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.
Instrucciones de iteración
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.
Ir declaraciones
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.
Funciones
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
declaración de la función
lambda declaración de la función
función de plantilla
especificador inline
especificaciones de excepción (obsoleto)
noexcept especificador (C++11)
Excepciones
Original:
Exceptions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Los espacios de nombres
Original:
Namespaces
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Tipos
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)
Los especificadores
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 especificadores
almacenamiento duración especificadores
constexpr especificador (C++11)
auto especificador (C++11)
alignas especificador (C++11)
Inicialización
Original:
Initialization
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Los literales
Original:
Literals
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Expresiones
Original:
Expressions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
representaciones alternativas
Utilidades
Original:
Utilities
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Tipos
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
alias de tipo de declaración (C++11)
atributos (C++11)
Lanza
Original:
Casts
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
conversiones implícitas
const_cast conversion
static_cast conversion
dynamic_cast conversion
reinterpret_cast conversion
C-cast estilo y funcional
De asignación de memoria
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.
Clases
Original:
Classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Clase propiedades específicas de la función
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.
Funciones especiales miembro
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.
Plantillas
Original:
Templates
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
clase de plantilla
función de plantilla
plantilla de especialización
paquetes de parámetros (C++11)
Varios
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Montaje en línea
 
  • auto -' automático duración de almacenamiento. (obsoleto)
    Original:
    auto - automatic storage duration. (obsoleto)
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • register -' automático duración de almacenamiento. También alude al compilador para colocar la variable en el registro del procesador. (obsoleto)
    Original:
    register - automatic storage duration. Also hints to the compiler to place the variable in the processor's register. (obsoleto)
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • static - duración de almacenamiento estático y' vinculación interna
    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 - duración de almacenamiento estático y vínculo externo
    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 - hilo' duración de almacenamiento. (desde C++11)
    Original:
    thread_local - thread storage duration. (desde C++11)
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.

Contenido

[editar] Explicación

[editar] Duración del almacenamiento

Todas las variables de un programa tienen una de las duraciones de almacenamiento siguientes:
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.
  • ' Automático "duración de almacenamiento. La variable se asigna al comienzo del bloque de código que encierra y cancela la asignación de punta. Todas las variables globales no tienen esta duración de almacenamiento, excepto los declarados static, extern o 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.
  • ' Estático' duración de almacenamiento. La variable se asigna cuando el programa comienza y desasigna cuando el programa termina. Sólo una instancia de la variable existe. Todas las variables globales tienen ese tiempo de almacenamiento, además de las declaradas con static o 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.
  • ' Hilo "duración de almacenamiento (desde C++11). La variable se asigna cuando el hilo empieza y desasigna cuando el hilo termina. Cada hilo tiene su propia instancia de la variable. Sólo las variables declaradas thread_local tener este tiempo de almacenamiento. thread_local sólo se puede declarar las variables globales, además de las declaradas con static o extern .
    Original:
    thread storage duration (desde 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.
  • ' Dinámico "duración de almacenamiento. La variable se asigna y se cancela la asignación por solicitud utilizando funciones asignación de memoria dinámica .
    Original:
    dynamic storage duration. The variable is allocated and deallocated per request by using asignación de memoria dinámica functions.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.

[editar] Vinculación

Varillaje refiere a la capacidad de una variable o función que se hace referencia en los otros ámbitos. Si una variable o función con el mismo identificador se declara en varios ámbitos, pero no se puede hacer referencia a partir de todos ellos, a continuación, varios ejemplos de la variable se generan. Los vínculos se reconocen los siguientes:
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.
  • ' Ninguna vinculación ". La variable puede ser denominado sólo del ámbito de aplicación es pulg Todas las variables con duraciones de almacenamiento automático, hilo y dinámica tienen esta vinculación .
    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.
  • ' Vinculación interna ". La variable se puede hacer referencia a partir de todos los ámbitos de la unidad de traducción actual. Todas las variables con una duración de almacenamiento estático que se declaren static o const pero no extern, tienen esta vinculación .
    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.
  • ' Vínculo externo'. La variable se puede hacer referencia a los ámbitos de las unidades de traducción en otros. Todas las variables con una duración de almacenamiento estático tienen esta vinculación, a excepción de aquellos static declarado, o const extern pero no .
    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.

[editar] Palabras clave

auto, register, static, extern, thread_local

[editar] Ejemplo