The Compare, Hash, and Pred template parameters should be constrained in the C++17 deduction guides for associative and unordered containers. The deduction guides for stack, queue and priority_queue are already constrained, but this patch makes them use the _RequireNotAllocator helper instead of reproducing the logic each time. PR libstdc++/89477 * include/bits/alloc_traits.h (_RequireNotAllocator): New helper for container deduction guides. * include/bits/hashtable.h (_RequireNotAllocatorOrIntegral): Likewise. * include/bits/stl_map.h (map): Use _RequireNotAllocator to constrain parameters in deduction guides. * include/bits/stl_multimap.h (multimap): Likewise. * include/bits/stl_multiset.h (multiset): Likewise. * include/bits/stl_queue.h (queue, priority_queue): Likewise. * include/bits/stl_set.h (set): Likewise. * include/bits/stl_stack.h (stack): Likewise. * include/bits/unordered_map.h (unordered_map, unordered_multimap): use _RequireNotAllocator and _RequireNotAllocatorOrIntegral to constrain parameters in deduction guides. * include/bits/unordered_set.h (unordered_set, unordered_multiset): Likewise. * testsuite/23_containers/map/cons/deduction.cc: Test additional deduction cases. * testsuite/23_containers/multiset/cons/deduction.cc: Likewise. * testsuite/23_containers/set/cons/deduction.cc: Likewise. * testsuite/23_containers/unordered_map/cons/deduction.cc: Likewise. * testsuite/23_containers/unordered_multimap/cons/deduction.cc: Likewise. * testsuite/23_containers/unordered_multiset/cons/deduction.cc: Likewise. * testsuite/23_containers/unordered_set/cons/deduction.cc: Likewise. From-SVN: r269234
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| allocator | Loading commit data... | |
| cons | Loading commit data... | |
| debug | Loading commit data... | |
| erase | Loading commit data... | |
| hash_policy | Loading commit data... | |
| insert | Loading commit data... | |
| modifiers | Loading commit data... | |
| operations | Loading commit data... | |
| operators | Loading commit data... | |
| requirements | Loading commit data... | |
| 48101-2_neg.cc | Loading commit data... | |
| 48101_neg.cc | Loading commit data... | |
| 55043.cc | Loading commit data... | |
| final_hash.cc | Loading commit data... | |
| init-list.cc | Loading commit data... | |
| observers.cc | Loading commit data... | |
| pmr_typedefs.cc | Loading commit data... | |
| pmr_typedefs_debug.cc | Loading commit data... | |
| range_access.cc | Loading commit data... |