COleCurrency Relational Operators
在条件为true,则比较两个货币值并返回非零;否则为0。
BOOL operator ==(
const COleCurrency& cur
) const;
BOOL operator !=(
const COleCurrency& cur
) const;
BOOL operator <(
const COleCurrency& cur
) const;
BOOL operator >(
const COleCurrency& cur
) const;
BOOL operator <=(
const COleCurrency& cur
) const;
BOOL operator >=(
const COleCurrency& cur
) const;
备注
备注
排序操作 (<, <=、>、>=) 的返回值是未定义的,如果其中一个操作数的状态为空或无效。相等运算符(==,!=)被视为操作数的状态。
示例
COleCurrency curOne(3, 5000); // 3.5
COleCurrency curTwo(curOne); // 3.5
BOOL b = (curOne == curTwo); // TRUE
b = curOne < curTwo; // FALSE, same value
b = curOne > curTwo; // FALSE, same value
b = curOne <= curTwo; // TRUE, same value
b = curOne >= curTwo; // TRUE, same value
curTwo.SetStatus(COleCurrency::invalid);
b = curOne == curTwo; // FALSE, different status
b = curOne != curTwo; // TRUE, different status
要求
Header: afxdisp.h