std::unique_ptr::get
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> pointer get() const; |
(desde C++11) | |
Retorna um ponteiro para o objeto gerenciado ou
nullptr se nenhum objeto é de propriedade.Original:
Returns a pointer to the managed object or
nullptr if no object is owned.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.
Parâmetros
(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.
You can help to correct and verify the translation. Click here for instructions.
Valor de retorno
Ponteiro para o objeto gerenciado ou
nullptr se nenhum objeto é de propriedade.Original:
Pointer to the managed object or
nullptr if no object is owned.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.
Exceções
Exemplo
std::unique_ptr<string> s_p = "Hello, world!";
string* s = s_p.get();
std::cout << *s << endl;
Saída:
Hello, world!
Veja também
retorna um ponteiro para o objeto gerenciado e libera a propriedade Original: returns a pointer to the managed object and releases the ownership 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) | |