名前空間
変種
操作

std::experimental::shared_ptr

From cppreference.com
 
 
 
 
 
ヘッダ <experimental/memory> で定義
template< class T > class shared_ptr;
(Library Fundamentals TS)

std::experimental::shared_ptr は、配列のサポートを追加した std::shared_ptr の修正版です。

目次

[編集] メンバ型

メンバ型 定義
element_type std::remove_extent_t<T>

[編集] メンバ関数

新しい shared_ptr を構築する
(public member function) [編集]
監視
格納されたポインターを返す
(public member function) [編集]
格納されたポインターを間接参照する
(public member function) [編集]
配列へのインデックスアクセスを提供します
(public member function) [編集]

[編集] 非メンバ関数

格納されたポインタにstatic_castdynamic_castconst_cast、またはreinterpret_castを適用する
(function template) [編集]

[編集] ヘルパークラス

std::experimental::shared_ptr のハッシュサポート
(class template specialization) [編集]

std::shared_ptr と同一のメンバおよび非メンバ

メンバ関数

以下のメンバ関数は、std::shared_ptr および std::weak_ptr の代わりに std::experimental::shared_ptr および std::experimental::weak_ptr で機能します。それ以外の動作は同一です。

参照している shared_ptr がこれ以上ない場合、所有するオブジェクトを破棄する
(public member function of std::shared_ptr<T>) [編集]
shared_ptr を代入します
(public member function of std::shared_ptr<T>) [編集]
変更
管理対象オブジェクトを置き換える
(public member function of std::shared_ptr<T>) [編集]
管理対象オブジェクトを交換する
(public member function of std::shared_ptr<T>) [編集]
監視
同じ管理オブジェクトを参照している shared_ptr オブジェクトの数を返す
(public member function of std::shared_ptr<T>) [編集]
(C++20まで)
管理オブジェクトが現在の shared_ptr オブジェクトのみによって管理されているかどうかをチェックする
(public member function of std::shared_ptr<T>) [編集]
保持しているポインタがヌルでないかをチェックします
(public member function of std::shared_ptr<T>) [編集]
共有ポインタの所有者ベースの順序を提供します
(std::shared_ptr<T> のパブリックメンバ関数) [編集]

非メンバ関数

これらの非メンバ関数は std::experimental 名前空間で宣言され、std::shared_ptr の代わりに std::experimental::shared_ptr で機能しますが、それ以外の動作は対応する C++14 の関数と同一です。

新しいオブジェクトを管理する共有ポインタを作成します
(関数テンプレート) [編集]
アロケータを使用して割り当てられた新しいオブジェクトを管理する共有ポインタを作成する
(関数テンプレート) [編集]
所有している場合、指定された型のデリータを返す
(関数テンプレート) [編集]
(C++20で削除)(C++20で削除)(C++20で削除)(C++20で削除)(C++20で削除)(C++20)
別の shared_ptr または nullptr と比較する
(関数テンプレート) [編集]
格納されたポインタの値を出力ストリームに出力する
(関数テンプレート) [編集]
std::swap アルゴリズムを特殊化する
(関数テンプレート) [編集]
std::shared_ptr のアトミック操作を特殊化する
(関数テンプレート) [編集]

ヘルパークラステンプレート

これらのクラステンプレートは std::experimental 名前空間で宣言され、std::shared_ptr および std::weak_ptr の代わりに std::experimental::shared_ptr および std::experimental::weak_ptr で機能しますが、それ以外の動作は対応する C++14 のクラステンプレートと同一です。

shared ポインタと weak ポインタの、所有者ベースの混合型の順序付けを提供します
(クラステンプレート) [編集]
オブジェクトが自身を参照する shared_ptr を作成できるようにします
(クラステンプレート) [編集]

[編集]

English 日本語 中文(简体) 中文(繁體)