month_formatter
month_formatter (month 포맷터)
std::formatter<std::chrono::month> 특수화가 std::chrono::month의 포맷 규칙을 정의해요. std::format과 함께 사용해요.
출처: cppreference
본문
std::formatter<std::chrono::month> 특수화는 <chrono> 헤더에 정의되어 있어요. C++20부터 사용 가능해요.
template< class CharT >
struct std::formatter<std::chrono::month, CharT>;
std::chrono::month의 포맷 규칙을 정의해요. %b, %B, %m, %Om 같은 월 포맷 스펙을 지원해요. 이 std::formatter 특수화는 보통 직접 접근하지 않고 std::chrono::format 같은 포맷 함수를 통해 사용돼요.
예제 (Example)
#include <chrono>
#include <format>
#include <iostream>
int main()
{
std::chrono::month m{7};
std::cout << std::format("{:%B %m}", m) << '\n'; // July 07
}