◐ Shell
clean mode source ↗

std::shared_ptr::operator<< - cppreference.com

Da cppreference.com.

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.

Click here for the English version of this page

<metanoindex/>

<tbody> </tbody>

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.

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.

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.

Valore di ritorno

os

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:

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) [modifica]