Espaços nominais
Variantes
Acções

std::is_move_constructible, std::is_trivially_move_constructible, std::is_nothrow_move_constructible

Da cppreference.com
< cpp‎ | types

 
 
Biblioteca de utilitários
Digite apoio (basic types, RTTI, type traits)
Gerenciamento de memória dinâmica
De tratamento de erros
Utilidades do programa
Variadic funções
Data e hora
Objetos de função
(C++11)
Os operadores relacionais
Original:
Relational operators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rel_ops::operator!=
rel_ops::operator>
rel_ops::operator<=
rel_ops::operator>=
Pares e tuplas
Original:
Pairs and tuples
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
Troque, avançar e avançar
Original:
Swap, forward and move
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)
 
Apoio a tipos
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 fundamentais
Tipos inteiros de largura fixos(C++11)
Limites 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 interface
Informações de tipo de tempo de execução
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.
Características 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.
Principais categorias 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)
Propriedades 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.
(C++11)
(C++11)
(C++11)
Operações apoiadas
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.
is_move_constructibleis_trivially_move_constructibleis_nothrow_move_constructible
(C++11)(C++11)(C++11)
Relacionamentos e consultas de propriedade
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)
Tipo modificações
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.
Transformações 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)
Digite constantes traço
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 no cabeçalho <type_traits>
template<class T >
struct is_move_constructible;
(1) (desde C++11)
template<class T >
struct is_trivially_move_constructible;
(2) (desde C++11)
template<class T >
struct is_nothrow_move_constructible;
(3) (desde C++11)
1)
Verifica se um tipo é MoveConstructible, ou seja, tem um construtor movimento acessível explícita ou implícita. Se a exigência for atendida, um membro constante valuetrue igual é fornecida, caso contrário, é valuefalse.
Original:
Checks whether a type is MoveConstructible, i.e. has an accessible explicit or implicit move constructor. If the requirement is met, a member constant value equal true is provided, otherwise 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.
2)
Mesmo que 1), mas a expressão construtor movimento não põe qualquer operação que não é trivial.
Original:
Same as 1), but the move constructor expression does not call any operation that is not trivial.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
3)
Mesmo que 1), mas a expressão construtor movimento é noexcept.
Original:
Same as 1), but the move constructor expression is noexcept.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Índice

Herdado de std::integral_constant

Member constants

value
[estática]
true se T is move-constructible , false contrário
Original:
true if T is move-constructible , false otherwise
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(membro estático público constante)

Member functions

operator bool
converte o objeto em bool, retorna value
Original:
converts the object to bool, returns value
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(função pública membro)

Member types

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
value_typebool
typestd::integral_constant<bool, value>

[editar]Notas

Mover construtores são geralmente noexcept, pois caso contrário, eles não são utilizáveis ​​em qualquer código que fornece garantia exceção forte.
Original:
Move constructors are usually noexcept, since otherwise they are unusable in any code that provides strong exception guarantee.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar]Possível implementação

template<class T>struct is_move_constructible :std::is_constructible<T, typenamestd::add_rvalue_reference<T>::type>{};   template<class T>struct is_trivially_move_constructible :std::is_trivially_constructible<T, typenamestd::add_rvalue_reference<T>::type>{};   template<class T>struct is_nothrow_move_constructible :std::is_nothrow_constructible<T, typenamestd::add_rvalue_reference<T>::type>{};

[editar]Exemplo

#include <iostream>#include <type_traits>   struct Ex1 {std::string str;// member has a non-trivial but non-throwing move ctor};struct Ex2 {int n; Ex2(Ex2&&)=default;// trivial and non-throwing};   int main(){std::cout<<std::boolalpha<<"Ex1 is move-constructible? "<< std::is_move_constructible<Ex1>::value<<'\n'<<"Ex1 is trivially move-constructible? "<< std::is_trivially_move_constructible<Ex1>::value<<'\n'<<"Ex1 is nothrow move-constructible? "<< std::is_nothrow_move_constructible<Ex1>::value<<'\n'<<"Ex2 is trivially move-constructible? "<< std::is_trivially_move_constructible<Ex2>::value<<'\n'<<"Ex2 is nothrow move-constructible? "<< std::is_nothrow_move_constructible<Ex2>::value<<'\n';}

Saída:

Ex1 is move-constructible? true Ex1 is trivially move-constructible? false Ex1 is nothrow move-constructible? true Ex2 is trivially move-constructible? true Ex2 is nothrow move-constructible? true

[editar]Veja também

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)[edit]
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)[edit]
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)[edit]
obtém uma referência rvalue se o construtor movimento não joga
Original:
obtains an rvalue reference if the move constructor does not throw
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(modelo de função)[edit]
close