deduction guides for std::unordered_multiset
Defined in header <unordered_set>
|
||
template<class InputIt, class Hash = std::hash<typename std::iterator_traits<InputIt>::value_type>, |
(1) | (since C++17) |
template<class T, class Hash = std::hash<T>, |
(2) | (since C++17) |
template<class InputIt, class Alloc> unordered_multiset(InputIt, InputIt, typename /*see below*/::size_type, Alloc) |
(3) | (since C++17) |
template<class InputIt, class Hash, class Alloc> unordered_multiset(InputIt, InputIt, typename /*see below*/::size_type, Hash, Alloc) |
(4) | (since C++17) |
template<class T, class Allocator> unordered_multiset(std::initializer_list<T>, typename /*see below*/::size_type, Allocator) |
(5) | (since C++17) |
template<class T, class Hash, class Alloc> unordered_multiset(std::initializer_list<T>, typename /*see below*/::size_type, Hash, Alloc) |
(6) | (since C++17) |
These deduction guides are provided for unordered_multiset to allow deduction from an iterator range (overloads (1,3,4)) and std::initializer_list (overloads (2,5.6)). This overload participates in overload resolution only if InputIt
satisfies LegacyInputIterator, Alloc
satisfies Allocator, neither Hash
nor Pred
satisfy Allocator, Hash
is not an integral type
Note: the extent to which the library determines that a type does not satisfy LegacyInputIterator is unspecified, except that as a minimum integral types do not qualify as input iterators. Likewise, the extent to which it determines that a type does not satisfy Allocator is unspecified, except that as a minimum the member type Alloc::value_type
must exist and the expression std::declval<Alloc&>().allocate(std::size_t{}) must be well-formed when treated as an unevaluated operand.
The size_type parameter type in these guides refers to the size_type member type of the type deduced by the deduction guide.
Example
#include <unordered_set> int main() { std::unordered_multiset s = {1,2,3,4}; // guide #2 deduces std::unordered_multiset<int> std::unordered_multiset s2(s.begin(), s.end()); // guide #1 deduces std::unordered_multiset<int> }