Espaços nominais
Variantes
Acções

std::static_pointer_cast, std::dynamic_pointer_cast, std::const_pointer_cast

Da cppreference.com
< cpp‎ | memory‎ | shared ptr

 
 
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)
 
Gerenciamento de memória dinâmica
Gerenciamento de memória de baixo nível
Alocadores
Original:
Allocators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Uninitialized armazenamento
Original:
Uninitialized storage
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Ponteiros inteligentes
Original:
Smart 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)
(C++11)
(C++11)
(obsoleta)
(C++11)
Apoio a coleta de lixo
Original:
Garbage collection support
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Diversos
Original:
Miscellaneous
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 Library
Original:
C Library
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
std::shared_ptr
Funções de membro
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
shared_ptr::shared_ptr
shared_ptr::~shared_ptr
shared_ptr::operator=
Modificadores
Original:
Modifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
shared_ptr::reset
shared_ptr::swap
Observadores
Original:
Observers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
shared_ptr::get
shared_ptr::operator*
shared_ptr::operator->
shared_ptr::use_count
shared_ptr::unique
shared_ptr::operator bool
shared_ptr::owner_before
Não-membros funções
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
static_pointer_castdynamic_pointer_castconst_pointer_cast
 
template<class T, class U >
shared_ptr<T> static_pointer_cast(const shared_ptr<U>& r );
(1) (desde C++11)
template<class T, class U >
shared_ptr<T> dynamic_pointer_cast(const shared_ptr<U>& r );
(2) (desde C++11)
template<class T, class U >
shared_ptr<T> const_pointer_cast(const shared_ptr<U>& r );
(3) (desde C++11)
Irá retornar uma nova instância std::shared_ptr com um tipo de objeto fundido gerenciado a partir do tipo r do objeto gerenciado. Ambos os ponteiros inteligentes irão compartilhar a propriedade do objeto gerenciado.
Original:
Will return a new instance of std::shared_ptr with a casted managed object type from the r's managed object type. Both smart pointers will share the ownership of the managed object.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
O objeto gerenciado std::shared_ptr resultando serão obtidos através do telefone (na respectiva ordem):
Original:
The resulting std::shared_ptr's managed object will be obtained by calling (in respective order):
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
1)static_cast<T*>(r.get()).
2)
dynamic_cast<T*>(r.get()) (Se o resultado da dynamic_cast é 0, o shared_ptr retornado será vazio).
Original:
dynamic_cast<T*>(r.get()) (If the result of the dynamic_cast is 0, the returned shared_ptr will be empty).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
3)const_cast<T*>(r.get()).
Em qualquer caso, se o parâmetro é uma rstd::shared_ptr vazia, o resultado será uma nova std::shared_ptr vazio.
Original:
In any case, if the parameter r is an empty std::shared_ptr the result will be a new empty std::shared_ptr.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar]Parâmetros

r -
O ponteiro para converter
Original:
The pointer to convert
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar]Exceções

noexcept specification:  
noexcept
  (desde C++11)
close