std::auto_ptr
De cppreference.com
[] |
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
<metanoindex/>
<tbody> </tbody>| Dclar dans l'en-tte <memory>
|
||
template< class T > class auto_ptr; |
(1) | (obsolte) |
template<> class auto_ptr<void> |
(2) | (obsolte) |
auto_ptr est un pointeur intelligent qui gre un objet obtenu par l'intermdiaire nouveau et supprime cet objet quand auto_ptr lui-mme est dtruit. Il peut tre utilis pour fournir une scurit pour les objets exception alloue dynamiquement, pour le passage de la proprit des objets allous 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.
You can help to correct and verify the translation. Click here for instructions.
Copie d'une copie
auto_ptr le pointeur et transfre la proprit 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 smantique de la copie inhabituelles, auto_ptr ne peuvent pas tre placs dans des conteneurs standards. std::unique_ptr est prfr 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.
You can help to correct and verify the translation. Click here for instructions.
2)
Spcialisation pour
void type est fourni, il dclare 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.
You can help to correct and verify the translation. Click here for instructions.
Types de membres
| Type du membre | Dfinition |
element_type
|
T
|
Fonctions membres
cre 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) | |
dtruit un auto_ptr et l'objet gr 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. (fonction membre publique) | |
transfre la proprit d'un autre 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. (fonction membre publique) | |
convertit le pointeur manag un pointeur de type diffrent 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. (fonction membre publique) | |
Original: Modifiers The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
dtruit l'objet gr 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. (fonction membre publique) | |
libre la proprit de l'objet gr 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. (fonction membre publique) | |
Original: Observers The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
obtient un pointeur vers l'objet gr 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. (fonction membre publique) | |
accde l'objet gr 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. (fonction membre publique) | |