std::chrono::month_weekday_last:: month, std::chrono::month_weekday_last:: weekday_last
From cppreference.net
<
cpp
|
chrono
|
month weekday last
C++
Date and time library
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::chrono::month_weekday_last
| Member functions | ||||
|
month_weekday_last::month
month_weekday_last::weekday_last
|
||||
| Nonmember functions | ||||
| Helper classes | ||||
|
constexpr
std::
chrono
::
month
month
(
)
const
noexcept
;
|
(1) | (C++20 이후) |
|
constexpr
std::
chrono
::
weekday_last
weekday_last
(
)
const
noexcept
;
|
(2) | (C++20 이후) |
* this 에 저장된 month 와 weekday_last 객체의 복사본을 반환합니다.
반환값
1)
*
this
에 저장된
std::chrono::month
객체의 사본.
2)
*
this
에 저장된
std::chrono::weekday_last
객체의 사본.
예제
이 코드 실행
#include <chrono> #include <iostream> using namespace std::chrono; int main() { std::cout << std::boolalpha; auto mwdl{March/Friday[last]}; // 3월의 마지막 금요일 auto ywdl{year(2024)/mwdl}; std::cout << (year_month_day{ywdl} == year_month_day{March/29/2024}) << ' '; // 2024년 다음 달의 마지막 금요일 mwdl = {(mwdl.month() + months(1))/mwdl.weekday_last()}; ywdl = {year(2024)/mwdl}; std::cout << (year_month_day{ywdl} == year_month_day{April/26/2024}) << '\n'; }
출력:
true true