Namespaces
Variants

std::chrono::weekday_last:: weekday

From cppreference.net
constexpr std:: chrono :: weekday weekday ( ) const noexcept ;
(C++20부터)

저장된 std::chrono::weekday 객체의 복사본을 * this 에서 가져옵니다.

반환값

std::chrono::weekday 객체에 저장된 사본을 * this 에 반환합니다.

예제

#include <chrono>
#include <iostream>
using namespace std::chrono;
int main()
{
    std::cout << std::boolalpha;
    auto wdl{Tuesday[last]}; // 한 달의 마지막 화요일
    std::cout << (year_month_day{wdl/10/2019} ==
                  year_month_day{October/29/2019}) << ' ';
    wdl = {(wdl.weekday() + days(2))[last]}; // 마지막 화요일이 이제 마지막 목요일이 됨
    std::cout << (year_month_day{wdl/10/2019} ==
                  year_month_day{October/31/2019}) << '\n';
}

출력:

true true