std::unique_ptr::get
De cppreference.com
<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!
