Support for day-count calculations of enum
-specified conventions.
More...
Namespaces |
namespace | bbldc |
Detailed Description
- Outline
-
-
- Purpose:
- Support for day-count calculations of
enum
-specified conventions.
-
- Classes:
-
- See also:
- Component bbldc_daycountconvention, Component bbldc_calendarbus252
-
- Description:
- This component provides a
struct
, bbldc::CalendarDayCountUtil
, that defines a suite of date-related functions used to compute the day count and the year fraction between two dates as prescribed by an enumerated day-count convention. Specifically, the daysDiff
and yearsDiff
methods defined in bbldc::CalendarDayCountUtil
take a trailing DayCountConvention::Enum
argument indicating which particular day-count convention to apply.
-
- Usage:
- This section illustrates intended use of this component.
-
- Example 1: Computing Day Count and Year Fraction:
- The following snippets of code illustrate how to use
bbldc::CalendarDayCountUtil
methods. First, create two bdlt::Date
variables, d1
and d2
: Then, create a calendar
with a valid range spanning 2003 and typical weekend days: Now, compute the day count between d1
and d2
according to the BUS-252 day-count convention: Finally, compute the year fraction between the two dates according to the BUS-252 day-count convention: