std::shared_ptr::operator<<
Da cppreference.com
< cpp | memory | shared ptr
![]() | 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. |
template<class T, class U, class V> basic_ostream<U, V>& operator<<(basic_ostream<U, V>& os, const shared_ptr<T>& ptr); | ||
Insere um
shared_ptr<T>
num std::basic_ostream.Original:
Inserts a
shared_ptr<T>
into a std::basic_ostream.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.
Equivalente a
os << ptr.get()
.Original:
Equivalent to
os << ptr.get()
.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.
Índice |
[editar]Parâmetros
os | - | um std::basic_ostream inserir ptr em Original: a std::basic_ostream to insert ptr into The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
ptr | - | os dados a serem inseridos em os Original: the data to be inserted into os The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[editar]Valor de retorno
os
[editar]Exemplo
#include <iostream>#include <memory> class Foo {}; int main(){auto sp =std::make_shared<Foo>();std::cout<< sp <<std::endl;std::cout<< sp.get()<<std::endl;}
Potencial saída:
0x6d9028 0x6d9028
[editar]Veja também
retorna um ponteiro para o objeto gerenciado Original: returns 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) |