diff --git a/cpp/meetup/meetup.cpp b/cpp/meetup/meetup.cpp new file mode 100644 index 0000000..29c3abc --- /dev/null +++ b/cpp/meetup/meetup.cpp @@ -0,0 +1,20 @@ +#include "meetup.h" + +namespace meetup { + +using namespace boost::gregorian; +typedef nth_day_of_the_week_in_month nth_dow; + + +scheduler::scheduler(int month, int year) + : month_(month) + , year_(year) +{ +} + +date_t scheduler::monteenth() const +{ + return nth_dow(/*nth_dow::first*/nth_dow::second, Monday, month_).get_date(year_); +} + +} diff --git a/cpp/meetup/meetup.h b/cpp/meetup/meetup.h new file mode 100644 index 0000000..d766e28 --- /dev/null +++ b/cpp/meetup/meetup.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +namespace meetup { + +typedef boost::gregorian::date date_t; + +class scheduler +{ + int month_, year_; + +public: + + scheduler(int month, int year); + + date_t monteenth() const; +}; + + +}