Espacios de nombres
Variantes
Acciones

std::is_const

De cppreference.com
< cpp‎ | types
 
 
 
Escriba apoyo
Tipos básicos
Original:
Basic types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Tipos fundamentales
Tipos fijos ancho enteros (C++11)
Límites numéricos
Original:
Numeric limits
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
C numérico limita interfaz
Información de tipo en tiempo de ejecución
Original:
Runtime type information
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Caracteres de tipo
Original:
Type traits
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Categorías primarias de tipo
Original:
Primary type categories
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
Propiedades de tipo
Original:
Type properties
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
is_const
(C++11)
(C++11)
(C++11)
Operaciones compatibles
Original:
Supported operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Relaciones y consultas de propiedad
Original:
Relationships and property queries
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
(C++11)
(C++11)
(C++11)
Modificaciones de tipo
Original:
Type modifications
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)(C++11)(C++11)
Transformaciones de tipo
Original:
Type transformations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
(C++11)
(C++11)
Escriba constantes rasgos
Original:
Type trait constants
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
Definido en el archivo de encabezado <type_traits>
template< class T >
struct is_const;
(desde C++11)
Si T es un tipo const-cualificada (es decir, const, o const volatile), proporciona el miembro constante value true igual. Para cualquier otro tipo, es value false .
Original:
If T is a const-qualified type (that is, const, or const volatile), provides the member constant value equal true. For any other type, value is false.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Contenido

Heredado de std::integral_constant

Constantes miembro

value
[estático]
true si T is a const-qualified type , de lo contrario, false
(miembro público estático constante)

Funciones miembro

operator bool
convierte el objeto a bool, devuelve value
(función miembro público)

Tipos miembro

Tipo Definición
value_type bool
type std::integral_constant<bool, value>

[editar] Posible implementación

template<class T> struct is_const          : std::false_type {};
template<class T> struct is_const<const T> : std::true_type {};

[editar] Ejemplo

#include <iostream>
#include <type_traits>
 
int main() 
{
    std::cout << boolalpha;
    std::cout << std::is_const<int>::value << '\n';
    std::cout << std::is_const<const int>::value  << '\n';
}

Salida:

false
true

[editar] Ver también

Comprueba si un tipo es volátil calificado
Original:
checks if a type is volatile-qualified
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(plantilla de clase) [editar]