Namespaces
Variants

std::experimental:: shared_ptr

From cppreference.net
ヘッダーで定義 <experimental/memory>
template < class T > class shared_ptr ;
(ライブラリ基盤 TS)

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

目次

メンバー型

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

メンバー関数

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

非メンバー関数

格納されたポインタに static_cast dynamic_cast const_cast または reinterpret_cast を適用する
(関数テンプレート)

ヘルパークラス

std::experimental::shared_ptrのハッシュサポート std::experimental::shared_ptr
(クラステンプレートの特殊化)

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

メンバー関数

以下のメンバー関数は、 std::experimental::shared_ptr の代わりに std::shared_ptr を、 std::experimental::weak_ptr の代わりに std::weak_ptr を使用します。それ以外の動作は同一です。

所有オブジェクトを破棄する(これ以上 shared_ptr がリンクしていない場合)
( std::shared_ptr<T> の公開メンバ関数)
shared_ptr を代入する
( std::shared_ptr<T> の公開メンバ関数)
モディファイア
管理対象オブジェクトを置き換える
( std::shared_ptr<T> の公開メンバ関数)
管理対象オブジェクトを交換する
( std::shared_ptr<T> の公開メンバ関数)
オブザーバ
同じ管理対象オブジェクトを参照している shared_ptr オブジェクトの数を返す
( std::shared_ptr<T> の公開メンバ関数)
(C++20まで)
管理対象オブジェクトが現在の shared_ptr オブジェクトによってのみ管理されているかどうかをチェックする
( std::shared_ptr<T> の公開メンバ関数)
格納されたポインタがnullでないかどうかをチェックする
( std::shared_ptr<T> の公開メンバ関数)
共有ポインタの所有者ベースの順序付けを提供する
( std::shared_ptr<T> の公開メンバ関数)

非メンバー関数

これらの非メンバ関数は std::experimental 名前空間で宣言されており、 std::experimental::shared_ptr と連携しますが、 std::shared_ptr ではなく、それ以外の点では対応するC++14の関数と同一の動作をします。

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

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

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

(C++11)
共有ポインタと弱ポインタの混合型所有者ベースの順序付けを提供する
(クラステンプレート)
オブジェクトが自身を参照する shared_ptr を作成できるようにする
(クラステンプレート)