Espaços nominais
Variantes
Acções

std::auto_ptr

Da cppreference.com
< cpp‎ | memory

 
 
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
initializer_list(C++11)
bitset
hash(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.
pair
tuple(C++11)
piecewise_construct_t(C++11)
piecewise_construct(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.
swap
forward(C++11)
move(C++11)
move_if_noexcept(C++11)
declval(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.
allocator
allocator_traits(C++11)
allocator_arg_t(C++11)
allocator_arg(C++11)
uses_allocator(C++11)
scoped_allocator_adaptor(C++11)
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.
uninitialized_copy
uninitialized_copy_n(C++11)
uninitialized_fill
uninitialized_fill_n
raw_storage_iterator
get_temporary_buffer
return_temporary_buffer
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.
unique_ptr(C++11)
shared_ptr(C++11)
weak_ptr(C++11)
auto_ptr(obsoleta)
owner_less(C++11)
enable_shared_from_this(C++11)
bad_weak_ptr(C++11)
default_delete(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.
declare_reachable(C++11)
undeclare_reachable(C++11)
declare_no_pointers(C++11)
undeclare_no_pointers(C++11)
pointer_safety(C++11)
get_pointer_safety(C++11)
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.
pointer_traits(C++11)
addressof(C++11)
align(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::auto_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.
auto_ptr::auto_ptr
auto_ptr::~auto_ptr
auto_ptr::operator=
auto_ptr::operator*
auto_ptr::operator->
auto_ptr::get
auto_ptr::release
auto_ptr::reset
auto_ptr::operator auto_ptr<Y>
 
Defined in header <memory>
template< class T > class auto_ptr;
(1) (obsoleta)
template<> class auto_ptr<void>
(2) (obsoleta)
auto_ptr é um ponteiro inteligente que gerencia um objeto obtido através de novo e elimina o objeto quando auto_ptr si é destruído. Ele pode ser usado para garantir a segurança de exceção para objetos dinamicamente alocados, para passar a propriedade de objetos dinamicamente alocados em funções e retornando objetos dinamicamente alocados de funções.
Original:
auto_ptr is a smart pointer that manages an object obtained via new and deletes that object when auto_ptr itself is destroyed. It may be used to provide exception safety for dynamically-allocated objects, for passing ownership of dynamically-allocated objects into functions and for returning dynamically-allocated objects from functions.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Copiando um auto_ptr copia o ponteiro e transfere a propriedade para o destino: tanto a construção de cópia e de atribuição de cópia de auto_ptr modificar seus argumentos mão direita, e da "cópia" não é igual ao original. Devido a estas semântica de cópia não usuais, auto_ptr não podem ser colocados em contentores normalizados. std::unique_ptr é o preferido para este e para outros fins.
Original:
Copying an auto_ptr copies the pointer and transfers ownership to the destination: both copy construction and copy assignment of auto_ptr modify their right hand arguments, and the "copy" is not equal to the original. Because of these unusual copy semantics, auto_ptr may not be placed in standard containers. std::unique_ptr is preferred for this and other uses.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
Especialização para void tipo é fornecido, ele declara a element_type typedef, mas não as funções de membro.
Original:
Specialization for type void is provided, it declares the typedef element_type, but no member functions.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Índice

[editar] Tipos de membro

Tipo de membro
Original:
Member type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Definition
element_type T

[editar] Funções de membro

cria um novo auto_ptr
Original:
creates a new auto_ptr
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)
destrói um auto_ptr eo objeto gerenciado
Original:
destroys an auto_ptr and 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)
transfere a propriedade de outro auto_ptr
Original:
transfers ownership from another auto_ptr
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)
converte o ponteiro conseguiu um ponteiro para tipo diferente
Original:
converts the managed pointer to a pointer to different type
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)
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.
destrói o objeto gerenciado
Original:
destroys 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)
libera a propriedade do objeto gerenciado
Original:
releases 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.

(função pública membro)
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.
obtém um ponteiro para o objeto gerenciado
Original:
obtains a pointer to 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)
acessa o objeto gerenciado
Original:
accesses 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)