次の方法で共有


CHeapPtr::operator =

代入演算子。

CHeapPtr< T, Allocator >& operator =(
   CHeapPtr< T, Allocator >& p 
) throw( );

パラメーター

  • p
    既存の CHeapPtr オブジェクト。

戻り値

更新された CHeapPtrへの参照を返します。

使用例

// Create a new CHeapPtr object
CHeapPtr <int> myHP;
// Allocate space for 10 integers on the heap
myHP.Allocate(10);
// Create a second heap pointer
// and assign it to the first pointer.
CHeapPtr <int> myHP2;
myHP2 = myHP;   

必要条件

Header: atlalloc.h

参照

関連項目

CHeapPtr クラス