std::shared_ptr<T>::operator<<
De cppreference.com
< cpp | memory | shared ptr
![]() |
Esta página se ha traducido por ordenador/computador/computadora de la versión en inglés de la Wiki usando Google Translate.
La traducción puede contener errores y palabras aparatosas/incorrectas. Planea sobre el texto para ver la versión original. Puedes ayudar a corregir los errores y mejorar la traducción. Para instrucciones haz clic aquí. |
template <class T, class U, class V> basic_ostream<U, V>& operator<<(basic_ostream<U, V>& os, const shared_ptr<T>& ptr); |
||
Inserta un
shared_ptr<T>
en 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.
Contenido |
[editar] Parámetros
os | - | un std::basic_ostream para insertar en
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 | - | los datos para ser insertado en
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] Ejemplo
Ejecuta este código
#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; }
Posible salida:
0x6d9028 0x6d9028
[editar] Ver también
Devuelve el puntero almacenado. (función miembro pública) |