std::shared_ptr::operator<<
Da cppreference.com.
< cpp | memory | shared ptr
![]() |
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.
La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
template <class T, class U, class V> basic_ostream<U, V>& operator<<(basic_ostream<U, V>& os, const shared_ptr<T>& ptr); |
||
Inserisce un
shared_ptr<T>
in un 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.
Indice |
[modifica] Parametri
os | - | un std::basic_ostream da inserire in
ptr 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 | - | i dati da inserire nella
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. |
[modifica] Valore di ritorno
os
[modifica] Esempio
#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; }
Possible output:
0x6d9028 0x6d9028
[modifica] Vedi anche
restituisce un puntatore all'oggetto gestito 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. (metodo pubblico) |