added CTAD docs (#167)

* added CTAD docs for unordered_map

* added CTAD docs for unordered_multimap

* added CTAD docs for unordered_set

* s/Deduction guides/Deduction Guides

* added CTAD docs for unordered_multiset

* added CTAD docs for unordered_flat_map

* added CTAD docs for unordered_flat_set
This commit is contained in:
joaquintides
2022-11-22 16:39:57 +01:00
committed by GitHub
parent 5aff5b943f
commit ee8f2b991f
6 changed files with 592 additions and 115 deletions
+83 -19
View File
@@ -182,26 +182,70 @@ namespace boost {
void xref:#unordered_set_rehash[rehash](size_type n);
void xref:#unordered_set_reserve[reserve](size_type n);
};
// Deduction Guides
template<class InputIterator,
class Hash = boost::hash<xref:#unordered_set_iter_value_type[__iter-value-type__]<InputIterator>>,
class Pred = std::equal_to<xref:#unordered_set_iter_value_type[__iter-value-type__]<InputIterator>>,
class Allocator = std::allocator<xref:#unordered_set_iter_value_type[__iter-value-type__]<InputIterator>>>
unordered_set(InputIterator, InputIterator, typename xref:#unordered_set_deduction_guides[__see below__]::size_type = xref:#unordered_set_deduction_guides[__see below__],
Hash = Hash(), Pred = Pred(), Allocator = Allocator())
-> unordered_set<xref:#unordered_set_iter_value_type[__iter-value-type__]<InputIterator>, Hash, Pred, Allocator>;
template<class T, class Hash = boost::hash<T>, class Pred = std::equal_to<T>,
class Allocator = std::allocator<T>>
unordered_set(std::initializer_list<T>, typename xref:#unordered_set_deduction_guides[__see below__]::size_type = xref:#unordered_set_deduction_guides[__see below__],
Hash = Hash(), Pred = Pred(), Allocator = Allocator())
-> unordered_set<T, Hash, Pred, Allocator>;
template<class InputIterator, class Allocator>
unordered_set(InputIterator, InputIterator, typename xref:#unordered_set_deduction_guides[__see below__]::size_type, Allocator)
-> unordered_set<xref:#unordered_set_iter_value_type[__iter-value-type__]<InputIterator>,
boost::hash<xref:#unordered_set_iter_value_type[__iter-value-type__]<InputIterator>>,
std::equal_to<xref:#unordered_set_iter_value_type[__iter-value-type__]<InputIterator>>, Allocator>;
template<class InputIterator, class Allocator>
unordered_set(InputIterator, InputIterator, Allocator)
-> unordered_set<xref:#unordered_set_iter_value_type[__iter-value-type__]<InputIterator>,
boost::hash<xref:#unordered_set_iter_value_type[__iter-value-type__]<InputIterator>>,
std::equal_to<xref:#unordered_set_iter_value_type[__iter-value-type__]<InputIterator>>, Allocator>;
template<class InputIterator, class Hash, class Allocator>
unordered_set(InputIterator, InputIterator, typename xref:#unordered_set_deduction_guides[__see below__]::size_type, Hash, Allocator)
-> unordered_set<xref:#unordered_set_iter_value_type[__iter-value-type__]<InputIterator>, Hash,
std::equal_to<xref:#unordered_set_iter_value_type[__iter-value-type__]<InputIterator>>, Allocator>;
template<class T, class Allocator>
unordered_set(std::initializer_list<T>, typename xref:#unordered_set_deduction_guides[__see below__]::size_type, Allocator)
-> unordered_set<T, boost::hash<T>, std::equal_to<T>, Allocator>;
template<class T, class Allocator>
unordered_set(std::initializer_list<T>, Allocator)
-> unordered_set<T, boost::hash<T>, std::equal_to<T>, Allocator>;
template<class T, class Hash, class Allocator>
unordered_set(std::initializer_list<T>, typename xref:#unordered_set_deduction_guides[__see below__]::size_type, Hash, Allocator)
-> unordered_set<T, Hash, std::equal_to<T>, Allocator>;
// Equality Comparisons
template<class Key, class Hash, class Pred, class Alloc>
bool xref:#unordered_set_operator[operator++==++](const unordered_set<Key, Hash, Pred, Alloc>& x,
const unordered_set<Key, Hash, Pred, Alloc>& y);
template<class Key, class Hash, class Pred, class Alloc>
bool xref:#unordered_set_operator_2[operator!=](const unordered_set<Key, Hash, Pred, Alloc>& x,
const unordered_set<Key, Hash, Pred, Alloc>& y);
// swap
template<class Key, class Hash, class Pred, class Alloc>
void xref:#unordered_set_swap_2[swap](unordered_set<Key, Hash, Pred, Alloc>& x,
unordered_set<Key, Hash, Pred, Alloc>& y)
noexcept(noexcept(x.swap(y)));
template<class K, class H, class P, class A, class Predicate>
typename unordered_set<K, H, P, A>::size_type
xref:#unordered_set_erase_if[erase_if](unordered_set<K, H, P, A>& c, Predicate pred);
}
// Equality Comparisons
template<class Key, class Hash, class Pred, class Alloc>
bool xref:#unordered_set_operator[operator++==++](const unordered_set<Key, Hash, Pred, Alloc>& x,
const unordered_set<Key, Hash, Pred, Alloc>& y);
template<class Key, class Hash, class Pred, class Alloc>
bool xref:#unordered_set_operator_2[operator!=](const unordered_set<Key, Hash, Pred, Alloc>& x,
const unordered_set<Key, Hash, Pred, Alloc>& y);
// swap
template<class Key, class Hash, class Pred, class Alloc>
void xref:#unordered_set_swap_2[swap](unordered_set<Key, Hash, Pred, Alloc>& x,
unordered_set<Key, Hash, Pred, Alloc>& y)
noexcept(noexcept(x.swap(y)));
template<class K, class H, class P, class A, class Predicate>
typename unordered_set<K, H, P, A>::size_type
xref:#unordered_set_erase_if[erase_if](unordered_set<K, H, P, A>& c, Predicate pred);
-----
---
@@ -1384,6 +1428,26 @@ Invalidates iterators, and changes the order of elements. Pointers and reference
Throws:;; The function has no effect if an exception is thrown, unless it is thrown by the container's hash function or comparison function.
=== Deduction Guides
A deduction guide will not participate in overload resolution if any of the following are true:
- It has an `InputIterator` template parameter and a type that does not qualify as an input iterator is deduced for that parameter.
- It has an `Allocator` template parameter and a type that does not qualify as an allocator is deduced for that parameter.
- It has a `Hash` template parameter and an integral type or a type that qualifies as an allocator is deduced for that parameter.
- It has a `Pred` template parameter and a type that qualifies as an allocator is deduced for that parameter.
A `size_­type` parameter type in a deduction guide refers to the `size_­type` member type of the
container type deduced by the deduction guide. Its default value coincides with the default value
of the constructor selected.
==== __iter-value-type__
[listings,subs="+macros,+quotes"]
-----
template<class InputIterator>
using __iter-value-type__ =
typename std::iterator_traits<InputIterator>::value_type; // exposition only
-----
=== Equality Comparisons
==== operator==