std:: enable_nonlocking_formatter_optimization
|
헤더에 정의됨
<format>
|
||
|
template
<
class
T
>
constexpr bool enable_nonlocking_formatter_optimization = false ; |
(C++23부터) | |
이 템플릿은 구현체가 std::print 와 std::println 의 효율적인 구현을 가능하게 하기 위해 사용될 수 있습니다.
만약
std::enable_nonlocking_formatter_optimization<T>
가
true
라면, 타입
T
의 인자 출력은 더 효율적인 방식으로 수행될 수 있습니다 (자세한 내용은
std::print
참조).
std::enable_nonlocking_formatter_optimization
특수화는 다음 경우에
true
가 될 수 있습니다:
-
T는 std::formatter < T, CharT > 가 기본 표준 특수화 또는 라이브러리 타입에 대한 표준 특수화 인 타입들 중 하나입니다 (아래 참조). -
프로그램은 cv-unqualified
프로그램 정의 타입
T에 대해 이 템플릿을 특수화할 수 있습니다. 이러한 특수화는 상수 표현식에서 사용 가능 해야 하며 const bool 타입을 가져야 합니다.
목차 |
기본 표준 특수화
다음 목록에서,
CharT
는
char
또는
wchar_t
중 하나이며,
ArithmeticT
는
char
,
wchar_t
,
char8_t
,
char16_t
, 또는
char32_t
를 제외한 cv-한정자가 없는 모든 산술 타입입니다:
|
문자 포매터를 위한 비락킹 플래그
|
||
|
template
<>
constexpr bool enable_nonlocking_formatter_optimization < CharT > = true ; |
(1) | |
|
문자열 포매터를 위한 비락킹 플래그
|
||
|
template
<>
constexpr bool enable_nonlocking_formatter_optimization < CharT * > = true ; |
(2) | |
|
template
<>
constexpr bool enable_nonlocking_formatter_optimization < const CharT * > = true ; |
(3) | |
|
template
<
std::
size_t
N
>
constexpr bool enable_nonlocking_formatter_optimization < CharT [ N ] > = true ; |
(4) | |
|
template
<
class
Traits,
class
Alloc
>
constexpr
bool
enable_nonlocking_formatter_optimization
|
(5) | |
|
template
<
class
Traits
>
constexpr
bool
enable_nonlocking_formatter_optimization
|
(6) | |
|
산술 포매터를 위한 비락킹 플래그
|
||
|
template
<>
constexpr bool enable_nonlocking_formatter_optimization < ArithmeticT > = true ; |
(7) | |
|
포인터 포매터를 위한 비락킹 플래그
|
||
|
template
<>
constexpr bool enable_nonlocking_formatter_optimization < std:: nullptr_t > = true ; |
(8) | |
|
template
<>
constexpr bool enable_nonlocking_formatter_optimization < void * > = true ; |
(9) | |
|
template
<>
constexpr bool enable_nonlocking_formatter_optimization < const void * > = true ; |
(10) | |
라이브러리 타입을 위한 표준 특수화
다음 표준 템플릿들의 모든 특수화에 대한
enable_nonlocking_formatter_optimization
의 특수화는
true
로 정의됩니다:
-
std::chrono::zoned_time
템플릿 매개변수 타입
TimeZonePtr가 const std:: chrono :: time_zone * 일 때
다음 표준 템플릿들의 모든 특수화에 대해
enable_nonlocking_formatter_optimization
의 특수화는 조건부로
true
로 정의됩니다:
enable_nonlocking_formatter_optimization
의 모든
포맷 가능 범위 타입
에 대한 특수화는
false
로 항상 정의되며, 이는 범위 포맷 종류가
std
::
range_format
::
disabled
가 아닌 경우에 해당합니다.
참고 사항
| 기능 테스트 매크로 | 값 | 표준 | 기능 |
|---|---|---|---|
__cpp_lib_print
|
202403L
|
(C++26)
(DR23) |
스트림 잠금을 사용한 형식화된 출력 |
202406L
|
(C++26)
(DR23) |
더 많은 형식화 가능 타입에 대한 비잠금 포매터 최적화 활성화 |
참고 항목
|
(C++20)
|
주어진 타입에 대한 서식 규칙을 정의함
(클래스 템플릿) |
|
(C++23)
|
인수의
서식화된
표현을 사용하여
stdout
또는 파일 스트림에 출력함
(함수 템플릿) |
|
(C++23)
|
각 출력이 추가적인 새 줄로 종료된다는 점을 제외하고
std::print
와 동일함
(함수 템플릿) |