2016-05-27から1日間の記事一覧

C++1z shared_from_thisの指す先が書き換わらないことを規定

C++

thisポインタをstd::shared_ptrとして取得するための機能として、std::enable_shared_from_this基本クラスとそのメンバ関数shared_from_this()があります。 std::enable_shared_from_thisから派生したクラスのオブジェクトをnewしてshared_ptrのコンストラク…