Fix Missing CTAD (#169)

* Update deduction tests to include missing guides for set

* Add missing deduction guides for set
This commit is contained in:
Christian Mazakas
2022-11-22 07:39:39 -08:00
committed by GitHub
parent 108d4535e0
commit 5aff5b943f
3 changed files with 78 additions and 5 deletions

View File

@ -563,6 +563,21 @@ namespace boost {
class = boost::enable_if_t<detail::is_allocator_v<Allocator> > >
unordered_flat_set(std::initializer_list<T>, std::size_t, Hash, Allocator)
-> unordered_flat_set<T, Hash, std::equal_to<T>, Allocator>;
template <class InputIterator, class Allocator,
class = boost::enable_if_t<detail::is_input_iterator_v<InputIterator> >,
class = boost::enable_if_t<detail::is_allocator_v<Allocator> > >
unordered_flat_set(InputIterator, InputIterator, Allocator)
-> unordered_flat_set<
typename std::iterator_traits<InputIterator>::value_type,
boost::hash<typename std::iterator_traits<InputIterator>::value_type>,
std::equal_to<typename std::iterator_traits<InputIterator>::value_type>,
Allocator>;
template <class T, class Allocator,
class = boost::enable_if_t<detail::is_allocator_v<Allocator> > >
unordered_flat_set(std::initializer_list<T>, Allocator)
-> unordered_flat_set<T, boost::hash<T>, std::equal_to<T>, Allocator>;
#endif
} // namespace unordered

View File

@ -673,6 +673,20 @@ namespace boost {
unordered_set(std::initializer_list<T>, std::size_t, Hash, Allocator)
-> unordered_set<T, Hash, std::equal_to<T>, Allocator>;
template <class InputIterator, class Allocator,
class = boost::enable_if_t<detail::is_input_iterator_v<InputIterator> >,
class = boost::enable_if_t<detail::is_allocator_v<Allocator> > >
unordered_set(InputIterator, InputIterator, Allocator)
-> unordered_set<typename std::iterator_traits<InputIterator>::value_type,
boost::hash<typename std::iterator_traits<InputIterator>::value_type>,
std::equal_to<typename std::iterator_traits<InputIterator>::value_type>,
Allocator>;
template <class T, class Allocator,
class = boost::enable_if_t<detail::is_allocator_v<Allocator> > >
unordered_set(std::initializer_list<T>, Allocator)
-> unordered_set<T, boost::hash<T>, std::equal_to<T>, Allocator>;
#endif
template <class T, class H, class P, class A> class unordered_multiset
@ -1303,6 +1317,21 @@ namespace boost {
unordered_multiset(std::initializer_list<T>, std::size_t, Hash, Allocator)
-> unordered_multiset<T, Hash, std::equal_to<T>, Allocator>;
template <class InputIterator, class Allocator,
class = boost::enable_if_t<detail::is_input_iterator_v<InputIterator> >,
class = boost::enable_if_t<detail::is_allocator_v<Allocator> > >
unordered_multiset(InputIterator, InputIterator, Allocator)
-> unordered_multiset<
typename std::iterator_traits<InputIterator>::value_type,
boost::hash<typename std::iterator_traits<InputIterator>::value_type>,
std::equal_to<typename std::iterator_traits<InputIterator>::value_type>,
Allocator>;
template <class T, class Allocator,
class = boost::enable_if_t<detail::is_allocator_v<Allocator> > >
unordered_multiset(std::initializer_list<T>, Allocator)
-> unordered_multiset<T, boost::hash<T>, std::equal_to<T>, Allocator>;
#endif
////////////////////////////////////////////////////////////////////////////

View File

@ -269,14 +269,14 @@ template <template <class...> class UnorderedSet> void set_tests()
test_allocator<int> int_allocator;
/* template<class InputIt,
class Hash = std::hash<typename
std::iterator_traits<InputIt>::value_type>, class Pred =
class Hash = std::hash<typename
std::iterator_traits<InputIt>::value_type>, class Pred =
std::equal_to<typename std::iterator_traits<InputIt>::value_type>, class
Alloc = std::allocator<typename std::iterator_traits<InputIt>::value_type>>
unordered_set(InputIt, InputIt,
unordered_set(InputIt, InputIt,
typename see below ::size_type = see below,
Hash = Hash(), Pred = Pred(), Alloc = Alloc())
-> unordered_set<typename std::iterator_traits<InputIt>::value_type, Hash,
Hash = Hash(), Pred = Pred(), Alloc = Alloc())
-> unordered_set<typename std::iterator_traits<InputIt>::value_type, Hash,
Pred, Alloc>; */
{
@ -390,6 +390,35 @@ template <template <class...> class UnorderedSet> void set_tests()
BOOST_TEST_TRAIT_SAME(decltype(s),
UnorderedSet<int, hash_equals, std::equal_to<int>, test_allocator<int> >);
}
/*
template<class InputIterator, class Allocator>
unordered_set(InputIterator, InputIterator, Allocator)
-> unordered_set<iter-value-type<InputIterator>,
hash<iter-value-type<InputIterator>>,
equal_to<iter-value-type<InputIterator>>,
Allocator>;
*/
{
UnorderedSet s(y.begin(), y.end(), int_allocator);
BOOST_TEST_TRAIT_SAME(
decltype(s), UnorderedSet<int, boost::hash<int>, std::equal_to<int>,
test_allocator<int> >);
}
/*
template<class T, class Allocator>
unordered_set(initializer_list<T>, Allocator)
-> unordered_set<T, hash<T>, equal_to<T>, Allocator>;
*/
{
UnorderedSet s({1, 2}, int_allocator);
BOOST_TEST_TRAIT_SAME(
decltype(s), UnorderedSet<int, boost::hash<int>, std::equal_to<int>,
test_allocator<int> >);
}
}
#endif