year_month_operator_ltlt

year_month_operator_ltlt (year_month 출력)

std::chrono::year_month에 대한 operator<<는 년·월을 스트림에 출력해요.

출처: cppreference

본문

std::chrono::year_month의 스트림 출력 연산자는 <chrono> 헤더에 정의되어 있어요. C++20부터 사용 가능해요.

template< class CharT, class Traits >
std::basic_ostream<CharT, Traits>&
    operator<<( std::basic_ostream<CharT, Traits>& os,
                const std::chrono::year_month& ym );

ym연도-월 형태로 스트림에 출력해요. 유효하지 않은 부분이 있으면 표시를 붙여요.

예제 (Example)

#include <chrono>
#include <iostream>

int main()
{
    std::cout << 2020y / std::chrono::July << '\n'; // 2020-07
}

더 알아보기 (Learn more)

cppreference