forked from HowardHinnant/date
Added a few convenience field getters:
* year_month_weekday::weekday() * year_month_weekday::index() * year_month_weekday_last::weekday()
This commit is contained in:
@@ -34,6 +34,8 @@
|
||||
//
|
||||
// constexpr date::year year() const noexcept;
|
||||
// constexpr date::month month() const noexcept;
|
||||
// constexpr date::weekday weekday() const noexcept;
|
||||
// constexpr unsigned index() const noexcept;
|
||||
// constexpr date::weekday_indexed weekday_indexed() const noexcept;
|
||||
//
|
||||
// constexpr operator day_point() const noexcept;
|
||||
@@ -152,6 +154,8 @@ main()
|
||||
#endif
|
||||
static_assert(ymdl1.year() == 2015_y, "");
|
||||
static_assert(ymdl1.month() == aug, "");
|
||||
static_assert(ymdl1.weekday() == fri, "");
|
||||
static_assert(ymdl1.index() == 2u, "");
|
||||
static_assert(ymdl1.weekday_indexed() == fri[2], "");
|
||||
#if __cplusplus >= 201402
|
||||
constexpr day_point dp = ymdl1;
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
//
|
||||
// constexpr date::year year() const noexcept;
|
||||
// constexpr date::month month() const noexcept;
|
||||
// constexpr date::weekday weekday() const noexcept;
|
||||
// constexpr date::weekday_last weekday_last() const noexcept;
|
||||
//
|
||||
// constexpr operator day_point() const noexcept;
|
||||
@@ -146,6 +147,7 @@ main()
|
||||
static_assert(ymdl1.ok(), "");
|
||||
static_assert(ymdl1.year() == 2015_y, "");
|
||||
static_assert(ymdl1.month() == aug, "");
|
||||
static_assert(ymdl1.weekday() == fri, "");
|
||||
static_assert(ymdl1.weekday_last() == fri[last], "");
|
||||
#if __cplusplus >= 201402
|
||||
constexpr day_point dp = ymdl1;
|
||||
|
||||
Reference in New Issue
Block a user