std::chrono::month_day:: month, std::chrono::month_day:: day
From cppreference.net
C++
Date and time library
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::chrono::month_day
| Member functions | ||||
|
month_day::month
month_day::day
|
||||
| Nonmember functions | ||||
| Helper classes | ||||
|
(C++26)
|
|
constexpr
std::
chrono
::
month
month
(
)
const
noexcept
;
|
(1) | (C++20以降) |
|
constexpr
std::
chrono
::
day
day
(
)
const
noexcept
;
|
(1) | (C++20以降) |
この
month_day
オブジェクトに格納されている月と日の値を取得します。
戻り値
1)
格納されている
std::chrono::month
値を返します。
2)
格納された
std::chrono::day
値を返します。
例
このコードを実行
#include <chrono> int main() { constexpr auto md{std::chrono::July/15}; static_assert(md.month() == std::chrono::month(7)); static_assert(md.day() == std::chrono::day(15)); }