std:: range-default-formatter <std::range_format::map>
|
헤더에 정의됨
<format>
|
||
|
template
<
ranges::
input_range
R,
class
CharT
>
struct /*range-default-formatter*/ < range_format :: map , R, CharT > ; |
(C++23부터)
( 설명 전용* ) |
|
범위 타입을 위한 클래스 템플릿 /*range-default-formatter*/ 은 std:: format_kind < R > 가 std :: range_format :: map 인 경우, 범위를 키-값 매핑으로 서식 지정하기 위해 특수화됩니다.
목차 |
멤버 타입
| 멤버 | 정의 |
maybe-const-map
(private)
|
fmt-maybe-const
<
R, CharT
>
( 설명 전용 멤버 타입* ) |
element-type
(private)
|
std::
remove_cvref_t
<
ranges::
range_reference_t
<
maybe-const-map
>>
( 설명 전용 멤버 타입* ) |
데이터 멤버
| 멤버 | 정의 |
underlying_
(private)
|
element-type
및
CharT
타입의 기반 포매터
std::
range_formatter
<
element-type
, CharT
>
( 설명 전용 멤버 객체* ) |
멤버 함수
|
(생성자)
|
range-default-formatter
를 생성합니다
(public 멤버 함수) |
|
parse
|
range-format-spec
에 지정된 형식 지정자를 파싱합니다
(public 멤버 함수) |
|
format
|
range-format-spec
에 지정된 범위 형식화된 출력을 작성합니다
(public 멤버 함수) |
std:: range-default-formatter <std::range_format::map>:: range-default-formatter
|
constexpr
/*range-default-formatter*/
(
)
;
|
||
다음 코드와 동등합니다:
underlying_.
set_brackets
(
STATICALLY_WIDEN
<
CharT
>
(
"{"
)
, STATICALLY_WIDEN
<
CharT
>
(
"}"
)
)
;
underlying_.
underlying
(
)
.
set_brackets
(
{
}
,
{
}
)
;
underlying_.
underlying
(
)
.
set_separator
(
STATICALLY_WIDEN
<
charT
>
(
": "
)
)
;
여기서
STATICALLY_WIDEN
<
CharT
>
(
"..."
)
는
"..."
입니다 (만약
CharT
가
char
인 경우), 그리고
L
"..."
입니다 (만약
CharT
가
wchar_t
인 경우).
다음 조건 중 하나를 만족하지 않으면 프로그램은 ill-formed입니다:
-
element-type가 std::pair 의 특수화인 경우, 또는 -
element-type가 std::tuple 의 특수화이고std::tuple_size_v< element-type >가 2 인 경우.
std:: range-default-formatter <std::range_format::map>:: parse
|
template
<
class
ParseContext
>
constexpr auto parse ( ParseContext & ctx ) - > ParseContext :: iterator ; |
||
다음과 동등함:
return
underlying_
.
format
(
ctx
)
;
.
range-format-spec 의 끝을 지난 반복자를 반환합니다.
std:: range-default-formatter <std::range_format::map>:: format
|
template
<
class
FormatContext
>
auto format ( maybe - const - map & r, FormatContext & ctx ) const - > FormatContext :: iterator ; |
||
다음 코드와 동등합니다:
return
underlying_
.
format
(
r, ctx
)
;
.
출력 범위의 끝을 지난 반복자를 반환합니다.
참고 항목
|
(C++20)
|
주어진 타입에 대한 포맷팅 규칙을 정의함
(클래스 템플릿) |
|
(C++23)
|
범위 타입에 대한
std::formatter
특수화 구현을 지원하는 클래스 템플릿
(클래스 템플릿) |