std::chrono::year_month_day_last:: year, std::chrono::year_month_day_last:: month, std::chrono::year_month_day_last:: day, std::chrono::year_month_day_last:: month_day_last
From cppreference.net
<
cpp
|
chrono
|
year month day last
C++
Date and time library
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::chrono::year_month_day_last
| Member functions | ||||
|
year_month_day_last::year
year_month_day_last::month
year_month_day_last::day
year_month_day_last::month_day_last
|
||||
| Nonmember functions | ||||
| Helper classes | ||||
|
constexpr
std::
chrono
::
year
year
(
)
const
noexcept
;
|
(1) | (начиная с C++20) |
|
constexpr
std::
chrono
::
month
month
(
)
const
noexcept
;
|
(2) | (начиная с C++20) |
|
constexpr
std::
chrono
::
day
day
(
)
const
noexcept
;
|
(3) | (начиная с C++20) |
|
constexpr
std::
chrono
::
month_day_last
month_day_last
(
)
const
noexcept
;
|
(4) | (начиная с C++20) |
Извлекает значения полей, хранящиеся в этом
year_month_day_last
объекте.
Возвращаемое значение
1)
Возвращает сохраненное значение
std::chrono::year
.
2)
Возвращает сохраненное значение
std::chrono::month
.
3)
Значение
std::chrono::day
, соответствующее последнему дню сохраненного года и месяца. Если
this
-
>
ok
(
)
равно
false
, возвращаемое значение не определено.
4)
Объект
std::chrono::month_day_last
, созданный из
month()
.
Пример
Запустить этот код
#include <chrono> int main() { constexpr auto ymdl{std::chrono::last/11/2020}; static_assert ( ymdl.day() == std::chrono::day(30) && ymdl.month() == std::chrono::November && ymdl.year() == std::chrono::year(2020) && ymdl.month_day_last() == std::chrono::November/std::chrono::last ); }