次の方法で共有


COleDateTimeSpan 関係演算子

比較演算子です。

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

解説

[!メモ]

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));   

必要条件

Header: atlcomtime.h

参照

関連項目

COleDateTimeSpan クラス

階層図