Skip to content

"invalid bitset position" thrown when calling cron::cron_next<cron::cron_quartz_traits>(...) #35

@hanexthink

Description

@hanexthink

Hi,
It is noticed that for a date and time entry that correspond to Sundays the cron::cron_next<cron::cron_quartz_traits>(...) function throws an invalid bitset position exception. This case is deterministic and could be produced with following code snippet for example.

        std::tm currentRunTime{};
	currentRunTime.tm_sec = 0;
	currentRunTime.tm_min = 0;
	currentRunTime.tm_hour = 0;
	currentRunTime.tm_mday = 3;
	currentRunTime.tm_mon = 8;
	currentRunTime.tm_year = 123;
	currentRunTime.tm_wday = 0;
	currentRunTime.tm_yday = 245;
	currentRunTime.tm_isdst = 1;

	auto quartzExpression{ "0 0 */12 * * 1-7" };
	auto cronExpr = cron::make_cron<cron::cron_quartz_traits>(quartzExpression);
	auto nextRunTime = cron::cron_next<cron::cron_quartz_traits>(cronExpr, currentRunTime);

We'll be glad to have your insight on this subject.
Kind regards,
Hossein Afshari
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions