std::vprint_nonunicode
std::vprint_nonunicode (비유니코드 형식 문자열 출력)
형식 문자열 fmt에 따라 args를 형식화하고 결과를 출력 스트림에 쓰는 함수예요. 유니코드 변환 없이 출력해요. C++23부터 있어요.
출처: cppreference
본문
<print> 헤더에 정의돼 있어요.
// (1) C++23
void vprint_nonunicode( std::FILE* stream,
std::string_view fmt, std::format_args args );
// (2) C++23
void vprint_nonunicode_buffered
( std::FILE* stream, std::string_view fmt, std::format_args args );
// (3) C++23
void vprint_nonunicode_buffered
( std::string_view fmt, std::format_args args );
형식 문자열 fmt에 따라 args를 형식화하고 결과를 출력 스트림에 써요.
-
- 스트림에 대한 잠금을 유지하면서 형식화된 결과의 문자 표현을 그대로 써요. 유니코드 처리 없이 원시 문자 시퀀스로 출력해요.
- 2,3) 버퍼링된 변형으로, 형식화된 결과를 버퍼에 모았다가 한 번에 써요.
vprint_nonunicode는 보통 로케일·인코딩 변환이 필요 없을 때 쓰는 저수준 변형이에요.
예제
#include <cstdio>
#include <format>
int main()
{
std::vprint_nonunicode(stdout, "Count: {}", std::make_format_args(42));
// "Count: 42"
}