Shift original using the specified convention if valid.

Synopsis

Declared in <bdlt_calendarutil.h>

static
int
shiftIfValid(
    bdlt::Date* result,
    bdlt::Date const& original,
    bdlt::Calendar const& calendar,
    ShiftConvention convention);

Description

Load, into the specified result, the date of the business day that is derived from the specified original date based on the specified calendar according to the specified date‐shifting convention. Return 0 on success, and a non‐zero value, without modifying *result, if a valid business date cannot be found according to the convention within the valid range of calendar.

Return Value

0 on success, non‐zero on failure

Parameters

Name

Description

result

destination for the shifted date

original

starting date

calendar

calendar used for business‐day determination

convention

date‐shifting convention to apply

Created with MrDocs