◐ Shell
clean mode source ↗

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

Aus cppreference.com

<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);

Fügt eine shared_ptr<T> in eine 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.

Entspricht 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.

Parameter

os -

a std::basic_ostream um ptr eingefügt werden soll

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 -

die Daten mit der os eingefügt werden

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.

Rückgabewert

os

Beispiel

#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:

Siehe auch

liefert einen Zeiger auf das verwaltete Objekt
(öffentliche Elementfunktion) [edit]