COleDateTimeSpan 関係演算子

更新 : 2007 年 11 月

比較演算子です。

bool operator ==(
   const COleDateTimeSpan& dateSpan 
) const throw( );
bool operator !=(
   const COleDateTimeSpan& dateSpan 
) const throw( );
bool operator <(
   const COleDateTimeSpan& dateSpan 
) const throw( );
bool operator >(
   const COleDateTimeSpan& dateSpan 
) const throw( );
bool operator <=(
   const COleDateTimeSpan& dateSpan 
) const throw( );
bool operator >=(
   const COleDateTimeSpan& dateSpan 
) const throw( );

パラメータ

  • dateSpan
    比較する COleDateTimeSpan

戻り値

これらの演算子は 2 つの期間値を比較し、条件が真の場合は true を返します。それ以外は false を返します。

解説

7508a1t8.alert_note(ja-jp,VS.90).gifメモ :

どちらかのオペランドが無効である場合は、ATLASSERT が発生します。

使用例

COleDateTimeSpan spanOne(3, 12, 0, 0); // 3 days and 12 hours
COleDateTimeSpan spanTwo(spanOne);     // 3 days and 12 hours
BOOL b;
b = spanOne == spanTwo;                // TRUE
b = spanOne < spanTwo;                 // FALSE, same value
b = spanOne > spanTwo;                 // FALSE, same value
b = spanOne <= spanTwo;                // TRUE, same value
b = spanOne >= spanTwo;                // TRUE, same value   

spanTwo.SetStatus(COleDateTimeSpan::invalid);
b = spanOne == spanTwo;                // FALSE, different status
b = spanOne != spanTwo;                // TRUE, different status
COleDateTimeSpan ts1(100.0);   // one hundred days
COleDateTimeSpan ts2(110.0);   // ten more days

ASSERT((ts1 != ts2) && (ts1 < ts2) && (ts1 <= ts2));   

必要条件

ヘッダー : atlcomtime.h

参照

参照

COleDateTimeSpan クラス

階層図

その他の技術情報

COleDateTimeSpan のメンバ