- memory[meta header]
- std[meta namespace]
- shared_ptr[meta class]
- function[meta id-type]
- cpp11[meta cpp]
// 非配列版のみ
T* operator->() const noexcept;ポインタを通してオブジェクトにアクセスする。
get() != nullptr- get()[link get.md]
型Tが配列である場合、この関数が宣言されるかは未規定。定義される場合、その戻り値は未規定
#include <iostream>
#include <memory>
#include <string>
int main()
{
std::shared_ptr<std::string> p(new std::string("hello"));
std::cout << p->c_str() << std::endl;
}hello
- C++11
- GCC: 4.3.6
- Clang libc++, C++11 mode: 3.0
- ICC: ?
- Visual C++: 2008 (TR1), 2010, 2012, 2013