CTime 的比較運算子

比較運算子。

bool operator ==(
   CTime time 
) const throw( );
bool operator !=(
   CTime time 
) const throw( );
bool operator <(
   CTime time 
) const throw( );
bool operator >(
   CTime time 
) const throw( );
bool operator <=(
   CTime time 
) const throw( );
bool operator >=(
   CTime time 
) const throw( );

參數

  • time
    要比較的 CTime 物件。

傳回值

如果條件為 true 時,這些運算子會比較兩倍絕對和傳回 true ;否則 false

範例

CTime t1 = CTime::GetCurrentTime();
CTime t2 = t1 + CTimeSpan(0, 1, 0, 0);    // 1 hour later
ATLASSERT(t1 != t2);
ATLASSERT(t1 < t2);
ATLASSERT(t1 <= t2);   

需求

Header: atltime.h

請參閱

參考

CTime 的類別

階層架構圖