chrono_month_weekday

chrono_month_weekday (월·요일 타입)

std::chrono::month_weekday는 월과 그 월에서의 특정 요일(인덱스 포함)을 나타내는 타입이에요.

출처: cppreference

본문

std::chrono::month_weekday<chrono> 헤더에 정의된 클래스예요. C++20부터 사용 가능해요.

class month_weekday;

월과 그 월에서의 weekday_indexed를 저장해요.

멤버 함수

  • month() — 월을 반환
  • weekday_indexed() — 요일(인덱스 포함)을 반환
  • ok() — 유효한지 확인

예제 (Example)

#include <chrono>
#include <iostream>

int main()
{
    using namespace std::chrono;
    month_weekday mw = July / Monday[2];
    std::cout << unsigned(mw.month()) << '\n'; // 7
}

더 알아보기 (Learn more)

cppreference