Espaços nominais
Variantes
Acções

std::shared_ptr::operator=

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.
 
shared_ptr& operator=(const shared_ptr& r );
(1)
template<class Y >
shared_ptr& operator=(const shared_ptr<Y>& r );
(1)
shared_ptr& operator=( shared_ptr&& r );
(2)
template<class Y >
shared_ptr& operator=( shared_ptr<Y>&& r );
(2)
template<class Y >
shared_ptr& operator=(std::auto_ptr<Y>&& r );
(3)
template<class Y, class Deleter >
shared_ptr& operator=(std::unique_ptr<Y,Deleter>&& r );
(4)
Substitui o objeto gerenciado com a gerido por uma r.
Original:
Replaces the managed object with the one managed by r.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
1)
Ações propriedade do objeto gerenciado pelo r. Se r gere nenhum objeto, *this gere nenhum objeto também. A sobrecarga templated não participar na resolução de sobrecarga se Y* não é implicitamente conversível para T*. Equivalente a shared_ptr<T> p(r).swap(*this).
Original:
Shares ownership of the object managed by r. If r manages no object, *this manages no object too. The templated overload doesn't participate in the overload resolution if Y* is not implicitly convertible to T*. Equivalent to shared_ptr<T> p(r).swap(*this).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
Move-atribui um shared_ptr de r. Após a atribuição, *this contém uma cópia do estado anterior do r, r está vazio. A sobrecarga templated não participar na resolução de sobrecarga se Y* não é implicitamente conversível para T*. Equivalente a shared_ptr<T> p(std::move(r)).swap(*this).
Original:
Move-assigns a shared_ptr from r. After the assignment, *this contains a copy of the previous state of r, r is empty. The templated overload doesn't participate in the overload resolution if Y* is not implicitly convertible to T*. Equivalent to shared_ptr<T> p(std::move(r)).swap(*this).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
3) 4)
Transfere a propriedade do objeto gerenciado pelo r para *this. O deleter associado a r é armazenado para exclusão futuro do objeto gerenciado. r gere nenhum objeto após a chamada. Equivalente a shared_ptr<T> p(std::move(r)).swap(*this).
Original:
Transfers the ownership of the object managed by r to *this. The deleter associated to r is stored for future deletion of the managed object. r manages no object after the call. Equivalent to shared_ptr<T> p(std::move(r)).swap(*this).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Índice

[editar]Parâmetros

r -
outro ponteiro inteligente de compartilhar a posse ou aquisição da propriedade de
Original:
another smart pointer to share the ownership to or acquire the ownership from
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar]Valor de retorno

*this

[editar]Notas

A implementação pode atender as necessidades sem criar um objeto shared_ptr temporário.
Original:
The implementation may meet the requirements without creating a temporary shared_ptr object.
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

1-2)
noexcept specification:  
noexcept
  (desde C++11)
3)
(Nenhum)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
4-5)
noexcept specification:  
noexcept
  (desde C++11)

[editar]Exemplo

[editar]Veja também

substitui o objeto gerenciado
Original:
replaces 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.

(função pública membro)[edit]
close