Espaces de noms
Variantes
Affichages
Actions

std::auto_ptr

De cppreference.com
< cpp‎ | memory

 
 
 
La gestion dynamique de la mémoire
Faible niveau de gestion de la mémoire
Répartiteurs
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)
Non initialisée stockage
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
Pointeurs intelligents
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 (obsolète)
owner_less (C++11)
enable_shared_from_this (C++11)
bad_weak_ptr (C++11)
default_delete (C++11)
Soutien garbage collection
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)
Divers
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)
Bibliothèque C
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
Les fonctions membres
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>
 
Déclaré dans l'en-tête <memory>
template< class T > class auto_ptr;
(1) (obsolète)
template<> class auto_ptr<void>
(2) (obsolète)
auto_ptr est un pointeur intelligent qui gère un objet obtenu par l'intermédiaire nouveau et supprime cet objet quand auto_ptr lui-même est détruit. Il peut être utilisé pour fournir une sécurité pour les objets exception allouée dynamiquement, pour le passage de la propriété des objets alloués dynamiquement en fonction, et pour renvoyer les objets à affectation dynamique de fonctions .
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.
Copie d'une copie auto_ptr le pointeur et transfère la propriété à la destination: construction exemplaire à la fois et l'affectation copie de auto_ptr modifier leurs arguments de la main droite, et la "copie" n'est pas égal à l'original. En raison de ces sémantique de la copie inhabituelles, auto_ptr ne peuvent pas être placés dans des conteneurs standards. std::unique_ptr est préféré pour ceci et d'autres usages .
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)
Spécialisation pour void type est fourni, il déclare la element_type typedef, mais pas de fonctions membres .
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.

Sommaire

[modifier] Types de membres

Type du membre Définition
element_type T

[modifier] Fonctions membres

crée un nouveau 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.

(fonction membre publique)
détruit un auto_ptr et l'objet géré
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