std::shared_ptr::operator<<
STD::共享[医]PTR::操作符<<
template | | |
---|
插入shared_ptr<T>变成std::basic_ostream...
相当于os << ptr.get()...
参数
os | - | a std::basic_ostream to insert ptr into |
---|---|---|
ptr | - | the data to be inserted into os |
返回值
os
...
例
二次
#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;
}
二次
可能的产出:
二次
0x6d9028
0x6d9028
二次
另见
get | returns the stored pointer (public member function) |
---|
© cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。
http://en.cppreference.com/w/cpp/Memory/Shared[医]PTR/算子[医]LTLT