CAutoVectorPtr::Attach

更新 : 2007 年 11 月

既存のポインタの所有権を取得します。

void Attach(
   T* p 
) throw( );

パラメータ

  • p
    CAutoVectorPtr オブジェクトが所有権を取得するポインタ。

解説

CAutoVectorPtr オブジェクトは、このポインタの所有権を取得すると、ポインタおよびスコープの外にある割り当て済みデータを自動的に削除します。CAutoVectorPtr::Detach が呼び出された場合、割り当てられたリソースの解放に関する責任は再度プログラマが負います。

デバッグ ビルドでは、CAutoVectorPtr::m_p メンバ変数が既存の値を指している場合、つまり NULL でない場合に、アサーション エラーが発生します。

必要条件

ヘッダー : atlbase.h

参照

参照

CAutoVectorPtr クラス

CAutoVectorPtr::Detach

CAutoVectorPtr::operator =

その他の技術情報

CAutoVectorPtr のメンバ