std::shared_ptr<T>::operator<<
提供: cppreference.com
< cpp | memory | shared ptr
template <class T, class U, class V> std::basic_ostream<U, V>& operator<<(std::basic_ostream<U, V>& os, const std::shared_ptr<T>& ptr); |
||
ptr
に格納されているポインタの値を出力ストリーム os
に挿入します。
os << ptr.get() と同等です。
目次 |
[編集] 引数
os | - | ptr を挿入する std::basic_ostream
|
ptr | - | os に挿入されるデータ
|
[編集] 戻り値
os。
[編集] 例
Run this code
#include <iostream> #include <memory> class Foo {}; int main() { auto sp = std::make_shared<Foo>(); std::cout << sp << '\n'; std::cout << sp.get() << '\n'; }
出力例:
0x6d9028 0x6d9028
[編集] 関連項目
格納されているポインタを返します (パブリックメンバ関数) |