deduction guides for
std::map
|
헤더에 정의됨
<map>
|
||
|
template
<
class
InputIt,
class
Comp
=
std::
less
<
/*iter-key-t*/
<
InputIt
>>
,
|
(1) | (C++17부터) |
|
template
<
class
Key,
class
T,
|
(2) | (C++17부터) |
|
template
<
class
InputIt,
class
Alloc
>
map
(
InputIt, InputIt, Alloc
)
|
(3) | (C++17부터) |
|
template
<
class
Key,
class
T,
class
Alloc
>
map
(
std::
initializer_list
<
std::
pair
<
Key, T
>>
, Alloc
)
|
(4) | (C++17부터) |
|
template
<
ranges::
input_range
R,
class
Compare
=
std::
less
<
/*range-key-t*/
<
R
>
,
class
Alloc
=
std::
allocator
<
/*range-to-alloc-t*/
<
R
>>
>
|
(5) | (C++23부터) |
|
template
<
ranges::
input_range
R,
class
Alloc
>
map
(
std::
from_range_t
, R
&&
, Alloc
)
|
(6) | (C++23부터) |
|
설명 전용 헬퍼 타입 별칭
|
||
|
template
<
class
InputIt
>
using
/*iter-val-t*/
=
|
( 설명 전용* ) | |
|
template
<
class
InputIt
>
using
/*iter-key-t*/
=
|
( 설명 전용* ) | |
|
template
<
class
InputIt
>
using
/*iter-mapped-t*/
=
|
( 설명 전용* ) | |
|
template
<
class
InputIt
>
using
/*iter-to-alloc-t*/
=
|
( 설명 전용* ) | |
|
template
<
ranges::
input_range
Range
>
using
/*range-key-t*/
=
|
(C++23부터)
( 설명 전용* ) |
|
|
template
<
ranges::
input_range
Range
>
using
/*range-mapped-t*/
=
|
(C++23부터)
( 설명 전용* ) |
|
|
template
<
ranges::
input_range
Range
>
using
/*range-to-alloc-t*/
=
|
(C++23부터)
( 설명 전용* ) |
|
map
에 대해 반복자 범위(오버로드
(1,3)
)와
std::initializer_list
(오버로드
(2,4)
)로부터의 추론을 허용하기 위해 제공됩니다.
이 오버로드들은 다음 조건을 만족할 때에만 오버로드 해결에 참여합니다:
InputIt
가
LegacyInputIterator
요구 사항을 충족하고,
Alloc
가
Allocator
요구 사항을 충족하며,
Comp
가
Allocator
요구 사항을 충족하지 않는 경우입니다.
참고: 라이브러리가 특정 타입이
LegacyInputIterator
요구사항을 만족하지 않는다고 판단하는 범위는 명시되지 않았으나, 최소한 정수 타입들은 입력 반복자로 적합하지 않습니다. 마찬가지로, 특정 타입이
Allocator
요구사항을 만족하지 않는다고 판단하는 범위도 명시되지 않았으나, 최소한 멤버 타입
Alloc::value_type
이 존재해야 하며
std::
declval
<
Alloc
&
>
(
)
.
allocate
(
std::
size_t
{
}
)
표현식이 평가되지 않은 피연산자로 취급될 때 유효하게 형성되어야 합니다.
참고 사항
| 기능 테스트 매크로 | 값 | 표준 | 기능 |
|---|---|---|---|
__cpp_lib_containers_ranges
|
202202L
|
(C++23) | Ranges-aware 생성 및 삽입; 오버로드 ( 5,6 ) |
예제
결함 보고서
다음 동작 변경 결함 보고서들은 이전에 발표된 C++ 표준에 소급 적용되었습니다.
| DR | 적용 대상 | 게시된 동작 | 올바른 동작 |
|---|---|---|---|
| LWG 3025 | C++17 | initializer-list guides ( 2,4 ) take std:: pair < const Key, T > | use std:: pair < Key, T > |