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 /*тип-отображения-итератора*/ =

std:: tuple_element_t < 1 , /*тип-значения-итератора*/ < 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 ;
( только для демонстрации* )

Эти руководства по выводу предоставляются для чтобы разрешить вывод из:

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 и компаратор.
12) Тег std::sorted_unique_t , std::initializer_list и компаратор.

Эти перегрузки участвуют в разрешении перегрузки только если InputIt удовлетворяет требованиям LegacyInputIterator , Alloc удовлетворяет требованиям Allocator , и Comp не удовлетворяет требованиям Allocator .

Примечание: степень, в которой библиотека определяет, что тип не удовлетворяет требованиям LegacyInputIterator , не специфицирована, за исключением того, что как минимум целочисленные типы не квалифицируются как итераторы ввода. Аналогично, степень, в которой она определяет, что тип не удовлетворяет требованиям Allocator , не специфицирована, за исключением того, что как минимум тип-член Alloc::value_type должен существовать, и выражение std:: declval < Alloc & > ( ) . allocate ( std:: size_t { } ) должно быть корректным при рассмотрении как невычисляемый операнд.

Пример