Addition operators

Synopses

Declared in <bdlt_date.h>

Add the specified numDays to the specified date (same as date + numDays).

bdlt::Date
operator+(
    int numDays,
    Date const& date);

Return the date value that is later by the specified (signed) numDays from the specified date. The behavior is undefined unless the resulting value falls within the range of dates supported by this class (see isValidYearMonthDay). Note that numDays may be negative.

bdlt::Date
operator+(
    Date const& date,
    int numDays);

Return a Datetime object having a value that is the sum of the specified lhs (Datetime) and the specified rhs (DatetimeInterval). If 24 == lhs.hour(), the result is the same as if the hour attribute of lhs is 0. The behavior is undefined unless the resulting value is in the valid range for a Datetime object.

Return a Datetime object having a value that is the sum of the specified lhs (Datetime) and the specified rhs (bsls::TimeInterval). If 24 == lhs.hour(), the result is the same as if the hour attribute of lhs is 0. The behavior is undefined unless the resulting value is in the valid range for a Datetime object.

Return a Datetime object having a value that is the sum of the specified lhs (DatetimeInterval) and the specified rhs (Datetime). If 24 == rhs.hour(), the result is the same as if the hour attribute of rhs is 0. The behavior is undefined unless the resulting value is in the valid range for a Datetime object.

Return a DatetimeInterval object whose value is the sum of the specified lhs and rhs time intervals. The behavior is undefined unless the resulting time interval value is valid (i.e., the days field must not overflow a 32‐bit integer).

Return a Time value that is the sum of the specified lhs datetime interval and the specified rhs time.

bdlt::Time
operator+(
    DatetimeInterval const& lhs,
    Time const& rhs);

Return a Time value that is the sum of the specified lhs time and the specified rhs datetime interval.

bdlt::Time
operator+(
    Time const& lhs,
    DatetimeInterval const& rhs);

Return a Datetime object having a value that is the sum of the specified lhs (bsls::TimeInterval) and the specified rhs (Datetime). If 24 == rhs.hour(), the result is the same as if the hour attribute of rhs is 0. The behavior is undefined unless the resulting value is in the valid range for a Datetime object.

Created with MrDocs