Namespaces
Variants

deduction guides for std::flat_map

From cppreference.net

헤더 파일에 정의됨 <flat_map>
template < class KeyContainer, class MappedContainer,

class Compare = std:: less < typename KeyContainer :: value_type > >
flat_map ( KeyContainer, MappedContainer, Compare = Compare ( ) )
- > flat_map < typename KeyContainer :: value_type ,
typename MappedContainer :: value_type ,

Compare, KeyContainer, MappedContainer > ;
(1) (C++23부터)
template < class KeyContainer, class MappedContainer, class Allocator >

flat_map ( KeyContainer, MappedContainer, Allocator )
- > flat_map < typename KeyContainer :: value_type ,
typename MappedContainer :: value_type ,
std:: less < typename KeyContainer :: value_type > ,

KeyContainer, MappedContainer > ;
(2) (C++23부터)
template < class KeyContainer, class MappedContainer,

class Compare, class Allocator >
flat_map ( KeyContainer, MappedContainer, Compare, Allocator )
- > flat_map < typename KeyContainer :: value_type ,
typename MappedContainer :: value_type ,

Compare, KeyContainer, MappedContainer > ;
(3) (C++23부터)
template < class KeyContainer, class MappedContainer,

class Compare = std:: less < typename KeyContainer :: value_type > >
flat_map ( std:: sorted_unique_t , KeyContainer, MappedContainer,
Compare = Compare ( ) )
- > flat_map < typename KeyContainer :: value_type ,
typename MappedContainer :: value_type ,

Compare, KeyContainer, MappedContainer > ;
(4) (C++23 이후)
template < class KeyContainer, class MappedContainer, class Allocator >

flat_map ( std:: sorted_unique_t , KeyContainer, MappedContainer,
Allocator )
- > flat_map < typename KeyContainer :: value_type ,
typename MappedContainer :: value_type ,
std:: less < typename KeyContainer :: value_type > ,

KeyContainer, MappedContainer > ;
(5) (C++23 이후)
template < class KeyContainer, class MappedContainer,

class Compare, class Allocator >
flat_map ( std:: sorted_unique_t , KeyContainer, MappedContainer,
Compare, Allocator )
- > flat_map < typename KeyContainer :: value_type ,
typename MappedContainer :: value_type ,

Compare, KeyContainer, MappedContainer > ;
(6) (C++23부터)
template < class InputIt,

class Compare = std:: less < /*iter-key-t*/ < InputIt >> >
flat_map ( InputIt, InputIt, Compare = Compare ( ) )
- > flat_map < /*iter-key-t*/ < InputIt > ,

/*iter-mapped-t*/ < InputIt > , Compare > ;
(7) (C++23 이후)
template < class InputIt,

class Compare = std:: less < /*iter-key-t*/ < InputIt >> >
flat_map ( std:: sorted_unique_t , InputIt, InputIt,
Compare = Compare ( ) )
- > flat_map < /*iter-key-t*/ < InputIt > ,

/*iter-mapped-t*/ < InputIt > , Compare > ;
(8) (C++23부터)
template < ranges:: input_range R,

class Compare = std:: less < /*range-key-t*/ < R >> ,
class Allocator = allocator < byte > >
flat_map ( std:: from_range_t , R && , Compare = Compare ( ) ,
Allocator = Allocator ( ) )
- > flat_map < /*range-key-t*/ < R > , /*range-mapped-t*/ < R > , Compare,
std:: vector < /*range-key-t*/ < R > ,
/*alloc-rebind*/ < Allocator,
/*range-key-t*/ < R >>> ,
std:: vector < /*range-mapped-t*/ < R > ,
/*alloc-rebind*/ < Allocator,

/*range-mapped-t*/ < R >>>> ;
(9) (C++23부터)
template < ranges:: input_range R, class Allocator >

flat_map ( std:: from_range_t , R && , Allocator )
- > flat_map < /*range-key-t*/ < R > , /*range-mapped-t*/ < R > ,
std:: less < /*range-key-t*/ < R >> ,
std:: vector < /*range-key-t*/ < R > ,
/*alloc-rebind*/ < Allocator,
/*range-key-t*/ < R >>> ,
std:: vector < /*range-mapped-t*/ < R > ,
/*alloc-rebind*/ < Allocator,

/*range-mapped-t*/ < R >>>> ;
(10) (C++23부터)
template < class Key, class T, class Compare = std:: less < Key > >

flat_map ( std:: initializer_list < pair < Key, T >> , Compare = Compare ( ) )

- > flat_map < Key, T, Compare > ;
(11) (C++23부터)
template < class Key, class T, class Compare = std:: less < Key > >

flat_map ( std:: sorted_unique_t , std:: initializer_list < pair < Key, T >> ,
Compare = Compare ( ) )

- > flat_map < Key, T, Compare > ;
(12) (C++23 이후)
설명 전용 헬퍼 타입 별칭
template < class InputIt >

using /*iter-val-t*/ =

typename std:: iterator_traits < InputIt > :: value_type ;
( 설명 전용* )
template < class InputIt >

using /*iter-key-t*/ =

std:: remove_const_t < std:: tuple_element_t < 0 , /*iter-val-t*/ < InputIt >>> ;
( 설명 전용* )
template < class InputIt >

using /*iter-mapped-t*/ =

std:: tuple_element_t < 1 , /*iter-val-t*/ < InputIt >> ;
( 설명 전용* )
template < class Allocator, class T >

using /*alloc-rebind*/ =

typename std:: allocator_traits < Allocator > :: template rebind_alloc < T > ;
( 설명 전용* )
template < ranges:: input_range Range >

using /*range-key-t*/ =

std:: remove_const_t < typename ranges:: range_value_t < Range > :: first_type > ;
( 설명 전용* )
template < ranges:: input_range Range >

using /*range-mapped-t*/ =

typename ranges:: range_value_t < Range > :: second_type ;
( 설명 전용* )

이러한 deduction guides 에 대한 추론을 허용하기 위해 제공됩니다:

1) 키 컨테이너, 매핑된 컨테이너 및 비교자.
2) 키-컨테이너, 매핑된-컨테이너 및 할당자.
3) 키 컨테이너, 매핑된 컨테이너, 비교자 및 할당자.
4) std::sorted_unique_t 태그, 키 컨테이너, 매핑된 컨테이너 및 비교자.
5) std::sorted_unique_t 태그, 키 컨테이너, 매핑된 컨테이너 및 할당자.
6) std::sorted_unique_t 태그, 키 컨테이너, 매핑된 컨테이너, 비교자 및 할당자.
7) 반복자 범위와 비교자.
8) std::sorted_unique_t 태그, 반복자 범위 및 비교자.
9) std:: from_range_t 태그, 하나의 input_range 범위, 비교자 및 할당자.
10) std:: from_range_t 태그, 하나의 input_range 범위 및 할당자.
11) std::initializer_list 와 비교자(comparator).
12) std::sorted_unique_t 태그, std::initializer_list 그리고 비교자(comparator).

이 오버로드들은 다음 조건에서만 오버로드 해결에 참여합니다: InputIt LegacyInputIterator 요구 사항을 충족하고, Alloc Allocator 요구 사항을 충족하며, Comp Allocator 요구 사항을 충족하지 않는 경우에 한합니다.

참고: 라이브러리가 특정 타입이 LegacyInputIterator 요구사항을 만족하지 않는다고 판단하는 범위는 명시되지 않았으나, 최소한 정수 타입들은 입력 반복자로 적합하지 않습니다. 마찬가지로, 특정 타입이 Allocator 요구사항을 만족하지 않는다고 판단하는 범위도 명시되지 않았으나, 최소한 멤버 타입 Alloc::value_type 이 존재해야 하며 표현식 std:: declval < Alloc & > ( ) . allocate ( std:: size_t { } ) 가 평가되지 않은 피연산자로 취급될 때 형식이 올바르게 구성되어야 합니다.

예제