Operatori relazionali di COleDateTimeSpan

Operatori di confronto.

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

Parametri

  • dateSpan
    Oggetto COleDateTimeSpan da confrontare.

Valore restituito

Questi operatori confrontare due valori di intervallo e timespan true di restituire se la condizione è true, in caso contrario false.

Note

[!NOTA]

Un ATLASSERT si verificherà se uno degli operandi non è valido.

Esempio

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

Requisiti

Header: atlcomtime.h

Vedere anche

Riferimenti

Classe di COleDateTimeSpan

Grafico della gerarchia