Type support (basic types, RTTI, type traits)
Da cppreference.com
< cpp
![]() |
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. |
[editar] Tipos básicos
[editar] Tipos fundamentais definida pela linguagem
[editar] Outras tipos básicos e macros
Defined in header
<cstddef> | |
tipo inteiro sem sinal retornado pelo operador sizeof Original: unsigned integer type returned by the sizeof operator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (typedef) | |
assinado tipo inteiro retornado quando subtraindo dois ponteiros Original: signed integer type returned when subtracting two pointers The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (typedef) | |
(C++11) |
o tipo de nullptr ponteiro nulo literal Original: the type of the null pointer literal nullptr The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (typedef) |
definida pela implementação ponteiro nulo constante Original: implementation-defined null pointer constant The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (macro constante) | |
(C++11) |
Tipo POD com exigência de alinhamento tão grande quanto qualquer outro tipo escalar Original: POD type with alignment requirement as great as any other scalar type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (typedef) |
byte offset do início de um tipo padrão de disposição-membro especificado Original: byte offset from the beginning of a standard-layout type to specified member The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função macro) | |
Defined in header
<cstdbool> | |
__bool_true_false_are_defined (C++11) |
C compatibilidade macro constante, se expande para 1 constante inteira Original: C compatibility macro constant, expands to integer constant 1 The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (macro constante) |
Defined in header
<cstdalign> | |
__alignas_is_defined (C++11) |
C compatibilidade macro constante, se expande para 1 constante inteira Original: C compatibility macro constant, expands to integer constant 1 The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (macro constante) |
[editar] Tipos inteiros de largura fixos (desde C++11)
[editar] numeric_limits
Defined in header
<limits> | |
fornece uma interface para as propriedades da consulta de todos os tipos fundamentais numéricos . Original: provides an interface to query properties of all fundamental numeric types. The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
[editar] C numérico limita interface
[editar] Identificação do tipo de tempo de execução
contém informação de algum tipo, gerada pela implementation. Esta é a classe, retornado pelo operador typeid Original: contains some type's information, generated by the implementation. This is the class, returned by the typeid operator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) | |
(C++11) |
invólucro em torno de um objecto type_info , que pode ser usado como índice associativo e desordenadas recipientes associativas Original: wrapper around a type_info object, that can be used as index in associative and unordered associative containers The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) |
exceção que é lançada se um argumento em uma expressão typeid é nulo Original: exception that is thrown if an argument in a expressão typeid is null The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) | |
exceção que é acionada por uma expressão dynamic_cast inválido, ou seja, um elenco de tipo de referência falhar Original: exception that is thrown by an invalid dynamic_cast expression, i.e. a cast of reference type fails The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) |
[editar] Características de tipo NJ
Características de tipo define um tempo de compilação de interface baseada em modelo para consultar ou modificar as propriedades de tipos.
Original:
Type traits defines an compile-time template-based interface to query or modify the properties of types.
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.
[editar] Propriedades de tipo
Defined in header
<type_traits> | |
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) |
verifica se um tipo é void Original: checks if a type is void The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
verifica se um tipo é tipo integral Original: checks if a type is integral type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
verifica se um tipo é tipo de ponto flutuante Original: checks if a type is floating-point type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
verifica se o tipo é um tipo de matriz Original: checks if a type is an array type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
verifica se o tipo é um tipo de enumeração Original: checks if a type is an enumeration type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
verifica se o tipo é um tipo de união Original: checks if a type is an union type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
checks if a type is a class type (but not union type) (modelo de classe) |
(C++11) |
verifica se um tipo é um tipo de função Original: checks if a type is a function type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
verifica se um tipo é um tipo de ponteiro Original: checks if a type is a pointer type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
verifica se é um tipo de' lvalue referência Original: checks if a type is lvalue reference The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
verifica se um tipo é' referência rvalue Original: checks if a type is rvalue reference The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
verifica se um tipo é um ponteiro para um objeto membro não-estático Original: checks if a type is a pointer to a non-static member object The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
verifica se um tipo é um ponteiro para uma função membro não-estático Original: checks if a type is a pointer to a non-static member function The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
Original: Composite 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) |
verifica se um tipo é o tipo fundamental Original: checks if a type is fundamental type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
verifica se um tipo é o tipo de aritmética Original: checks if a type is arithmetic type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
verifica se um tipo é tipo escalar Original: checks if a type is scalar type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
verifica se um tipo é tipo de objeto Original: checks if a type is object type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
verifica se um tipo é tipo composto Original: checks if a type is compound type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
verifica se um tipo é lvalue referência ou referência rvalue Original: checks if a type is either lvalue reference or rvalue reference The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
checks if a type is a pointer to a non-static member function or object (modelo de classe) |
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. | |
(C++11) |
verifica se um tipo é const qualificado Original: checks if a type is const-qualified The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
verifica se um tipo é volátil qualificado 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. (modelo de classe) |
(C++11) |
verifica se um tipo é trivial Original: checks if a type is trivial The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
checks if a type is trivially copyable (modelo de classe) |
(C++11) |
verifica se um tipo é o layout padrão tipo Original: checks if a type is standard-layout type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
verifica se é um tipo simples de idade dados (POD) tipo Original: checks if a type is plain-old data (POD) type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
checks if a type is literal type (modelo de classe) |
(C++11) |
checks if a type is class (but not union) type and has no data (modelo de classe) |
(C++11) |
verifica se um tipo é o tipo de classe polimórfica Original: checks if a type is polymorphic class type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
verifica se um tipo é o tipo de classe abstrata Original: checks if a type is abstract class type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
verifica se um tipo é assinado tipo de aritmética Original: checks if a type is signed arithmetic type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
verifica se um tipo é o tipo de aritmética sem sinal Original: checks if a type is unsigned arithmetic type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
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. | |
(C++11) (C++11) (C++11) |
verifica se um tipo tem um construtor para argumentos específicos Original: checks if a type has a constructor for specific arguments The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
verifica se um tipo tem um construtor padrão Original: checks if a type has a default constructor The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) | |
(C++11) (C++11) (C++11) |
verifica se um tipo tem um construtor de cópia Original: checks if a type has a copy constructor The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) (C++11) (C++11) |
verifica se um tipo tem um construtor movimento Original: checks if a type has a move constructor The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) (C++11) (C++11) |
verifica se um tipo tem um operador de atribuição para um argumento específico Original: checks if a type has a assignment operator for a specific argument The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) (C++11) (C++11) |
verifica se um tipo tem um operador de atribuição de cópia Original: checks if a type has a copy assignment operator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) (C++11) (C++11) |
verifica se um tipo tem um operador de atribuição movimento Original: checks if a type has a move assignment operator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) (C++11) (C++11) |
verifica se um tipo tem um destrutor não-excluído Original: checks if a type has a non-deleted destructor The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
verifica se um tipo tem um destrutor virtual Original: checks if a type has a virtual destructor The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
Original: 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) |
obtém requisitos do tipo de alinhamento Original: obtains the type's alignment requirements The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
obtém o número de dimensões de um tipo de matriz Original: obtains the number of dimensions of an array type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
obtém o tamanho de um tipo de matriz ao longo de uma dimensão especificada Original: obtains the size of an array type along a specified dimension The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
Original: Type relationships The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
(C++11) |
Verifica se dois tipos são os mesmos Original: checks if two types are the same The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
checks if a type is derived from the other type (modelo de classe) |
(C++11) |
Verifica se um tipo pode ser convertida para o outro tipo Original: checks if a type can be converted to the other type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
[editar] Tipo modificações
Modelos de modificação do tipo criar novas definições de tipo, aplicando modificações em um parâmetro do modelo. O tipo resultante pode então ser acessado através
type
membro typedef.Original:
Type modification templates create new type definitions by applying modifications on a template parameter. The resulting type can then be accessed through
type
member typedef.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.
Defined in header
<type_traits> | |
Original: Const-volatility specifiers 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) |
remove const e / ou volatile especificadores do tipo de dado Original: removes const or/and volatile specifiers from the given type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) (C++11) (C++11) |
adds const or/and volatile specifiers to the given type (modelo de classe) |
Original: References The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
(C++11) |
remove referência do tipo de dado Original: removes reference from the given type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) (C++11) |
acrescenta lvalue ou' rvalue referência ao tipo de dado Original: adds lvalue or rvalue reference to the given type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
Original: Pointers The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
(C++11) |
remove ponteiro do tipo de dado Original: removes pointer from the given type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
acrescenta ponteiro para o tipo de dado Original: adds pointer to the given type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
Original: Sign modifiers The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
(C++11) |
faz o tipo de dado integrante assinado Original: makes the given integral type signed The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
faz o tipo de dado unsigned integrante Original: makes the given integral type unsigned The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
Original: Arrays The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
(C++11) |
remove uma medida do tipo matriz dada Original: removes one extent from the given array type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
removes all extents from the given array type (modelo de classe) |
[editar] Transformações diversas
Defined in header
<type_traits> | |
(C++11) |
define o tipo adequado para utilização como armazenamento não inicializada para tipos de determinado tamanho Original: defines the type suitable for use as uninitialized storage for types of given size The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
define o tipo adequado para utilização como armazenamento não inicializados para todos os tipos de dados Original: defines the type suitable for use as uninitialized storage for all given types The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
aplica transformações tipo como ao passar um argumento de função por valor Original: applies type transformations as when passing a function argument by value The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
esconde uma sobrecarga de função ou especialização de modelo com base em tempo de compilação boolean Original: hides a function overload or template specialization based on compile-time boolean The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
escolhe um tipo ou outro com base em compilação do tipo boolean Original: chooses one type or another based on compile-type boolean The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
deduces the result type of a mixed-mode arithmetic expression (modelo de classe) |
(C++11) |
obtém o tipo inteiro subjacente para um tipo de enumeração dado Original: obtains the underlying integer type for a given enumeration type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
deduz o tipo de retorno de uma expressão chamada de função Original: deduces the return type of a function call expression The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
[editar] Classes auxiliares
Defined in header
<type_traits> | |
(C++11) |
constante da compilação do tipo especificado com o valor especificado Original: compile-time constant of specified type with specified value The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
Duas especializações de std::integral_constant para o bool tipo são fornecidos:
Original:
Two specializations of std::integral_constant for the type bool are provided:
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.
Defined in header
<type_traits> | |
Tipo
Original: Type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Definition |
true_type
|
std::integral_constant<bool, true> |
false_type
|
std::integral_constant<bool, false> |