次の方法で共有


CPoint::operator +=

最初のオーバーロードは CPointにサイズを追加します。

void operator +=(
   SIZE size 
) throw( );
void operator +=(
   POINT point 
) throw( );

パラメーター

解説

2 番目のオーバーロードは CPointへのポインターを追加します。

どちらの場合も、アタッチは右側のオペランドの x (または) cxメンバーを CPointx のメンバーに追加し、CPointy のメンバーへの右オペランドの y (または) cyメンバーを追加することによって行われます。

たとえば、CPoint(5, -7) を CPoint(35, 33)への変更 CPoint(30, 40) の変数を含む変数に追加します。

使用例

CPoint   ptStart(100, 100);
CSize   szOffset(35, 35);

ptStart += szOffset;

CPoint   ptResult(135, 135);

ASSERT(ptResult == ptStart);

// also works on SIZE

ptStart = CPoint(100, 100);

SIZE   sz;
sz.cx = 35;
sz.cy = 35;

ptStart += sz;

ASSERT(ptResult == ptStart);   

必要条件

ヘッダー: atltypes.h

参照

関連項目

CPoint クラス

階層図

CPoint::operator -=

CPoint::operator +

CPoint::Offset