BDE 4.14.0 Production release
|
Provide common non-primitive operations on bdlt::DayOfWeek::Enum
.
This utility component provides a struct
, bdlt::DayOfWeekUtil
, that serves as a namespace for functions operating on the day-of-week enumeration.
This component provides the following (static) methods:
This section illustrates intended use of this component.
Suppose we have some event occurring every ten days. Today is the day of the performance, assumed to be a Friday, and we want to know when the previous one took place and when the next one will be.
First, we create a bdlt::DayOfWeek
variable for the current day:
Next, we calculate previous and following event days using the bdlt::DayOfWeekUtil::add
function:
Finally, we verify the resultant day-of-week values: