template< class InputIt,
class Hash = std::hash</*iter-key-t*/<InputIt>>,
class Pred = std::equal_to</*iter-key-t*/<InputIt>>,
class Alloc = std::allocator<iter-to-alloc-t<InputIt>> >
unordered_map( InputIt, InputIt,
typename /* 见下文 */::size_type = /* 见下文 */,
Hash = Hash(), Pred = Pred(), Alloc = Alloc() )
-> unordered_map</*iter-key-t*/<InputIt>, /*iter-val-t*/<InputIt>,
Hash, Pred, Alloc>;
|
(1) |
(C++17 起) |
template< class Key, class T, class Hash = std::hash<Key>,
class Pred = std::equal_to<Key>,
class Alloc = std::allocator<std::pair<const Key, T>> >
unordered_map( std::initializer_list<std::pair<Key, T>>,
typename /* 见下文 */::size_type = /* 见下文 */,
Hash = Hash(), Pred = Pred(), Alloc = Alloc() )
-> unordered_map<Key, T, Hash, Pred, Alloc>;
|
(2) |
(C++17 起) |
template< class InputIt, class Alloc >
unordered_map( InputIt, InputIt, typename /* 见下文 */::size_type, Alloc )
-> unordered_map</*iter-key-t*/<InputIt>, /*iter-val-t*/<InputIt>,
std::hash</*iter-key-t*/<InputIt>>,
std::equal_to</*iter-key-t*/<InputIt>>, Alloc>;
|
(3) |
(C++17 起) |
template< class InputIt, class Alloc >
unordered_map( InputIt, InputIt, Alloc )
-> unordered_map</*iter-key-t*/<InputIt>, /*iter-val-t*/<InputIt>,
std::hash</*iter-key-t*/<InputIt>>,
std::equal_to</*iter-key-t*/<InputIt>>, Alloc>;
|
(4) |
(C++17 起) |
template< class InputIt, class Hash, class Alloc >
unordered_map( InputIt, InputIt, typename /* 见下文 */::size_type, Hash,
Alloc )
-> unordered_map</*iter-key-t*/<InputIt>, /*iter-val-t*/<InputIt>, Hash,
std::equal_to</*iter-key-t*/<InputIt>>, Alloc>;
|
(5) |
(C++17 起) |
template< class Key, class T, typename Alloc >
unordered_map( std::initializer_list<std::pair<Key, T>>,
typename /* 见下文 */::size_type, Alloc )
-> unordered_map<Key, T, std::hash<Key>, std::equal_to<Key>, Alloc>;
|
(6) |
(C++17 起) |
template< class Key, class T, typename Alloc >
unordered_map( std::initializer_list<std::pair<Key, T>>, Alloc )
-> unordered_map<Key, T, std::hash<Key>, std::equal_to<Key>, Alloc>;
|
(7) |
(C++17 起) |
template< class Key, class T, class Hash, class Alloc >
unordered_map( std::initializer_list<std::pair<Key, T>>,
typename /* 见下文 */::size_type, Hash, Alloc )
-> unordered_map<Key, T, Hash, std::equal_to<Key>, Alloc>;
|
(8) |
(C++17 起) |
template< ranges::input_range R,
class Hash = std::hash</*range-key-t*/<R>>,
class Pred = std::equal_to</*range-key-t*/<R>>,
class Alloc = std::allocator</*range-to-alloc-t*/<R>> >
unordered_map( std::from_range_t, R&&,
typename /* 见下文 */::size_type = /* 见下文 */,
Hash = Hash(), Pred = Pred(), Alloc = Alloc() )
-> unordered_map</*range-key-t*/<R>, /*range-mapped-t*/<R>,
Hash, Pred, Alloc>;
|
(9) |
(C++23 起) |
template< ranges::input_range R, class Alloc >
unordered_map( std::from_range_t, R&&,
typename /* 见下文 */::size_type, Alloc )
-> unordered_map</*range-key-t*/<R>, /*range-mapped-t*/<R>,
std::hash</*range-key-t*/<R>>,
std::equal_to</*range-key-t*/<R>>, Alloc>;
|
(10) |
(C++23 起) |
template< ranges::input_range R, class Alloc >
unordered_map( std::from_range_t, R&&, Alloc )
-> unordered_map</*range-key-t*/<R>, /*range-mapped-t*/<R>,
std::hash</*range-key-t*/<R>>,
std::equal_to</*range-key-t*/<R>>, Alloc>;
|
(11) |
(C++23 起) |
template< ranges::input_range R, class Hash, class Alloc >
unordered_map( std::from_range_t, R&&, typename /* 见下文 */::size_type,
Hash, Alloc )
-> unordered_map</*range-key-t*/<R>, /*range-mapped-t*/<R>, Hash,
std::equal_to</*range-key-t*/<R>>, Alloc>;
|
(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 InputIt >
using /*iter-to-alloc-t*/ =
std::pair<std::add_const_t<tuple_element_t<0, /*iter-val-t*/<InputIt>>>,
std::tuple_element_t<1, /*iter-val-t*/<InputIt>>>;
|
|
(仅用于阐述*) |
template< ranges::input_range Range >
using /*range-key-t*/ =
std::remove_const_t<typename ranges::range_value_t<Range>::first_type>;
|
|
(C++23 起) (仅用于阐述*) |
template< ranges::input_range Range >
using /*range-mapped-t*/ =
typename ranges::range_value_t<Range>::second_type;
|
|
(C++23 起) (仅用于阐述*) |
template< ranges::input_range Range >
using /*range-to-alloc-t*/ =
std::pair<std::add_const_t<typename ranges::range_value_t<Range>::first_type>,
typename ranges::range_value_t<Range>::second_type>;
|
|
(C++23 起) (仅用于阐述*) |
| | |