@@ -604,6 +604,7 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
604
604
#include < __ranges/concepts.h>
605
605
#include < __ranges/container_compatible_range.h>
606
606
#include < __ranges/from_range.h>
607
+ #include < __type_traits/container_traits.h>
607
608
#include < __type_traits/enable_if.h>
608
609
#include < __type_traits/is_allocator.h>
609
610
#include < __type_traits/is_integral.h>
@@ -1830,6 +1831,15 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const unordered_map<_Key, _Tp, _Has
1830
1831
1831
1832
#endif
1832
1833
1834
+ template <class _Key , class _Tp , class _Hash , class _Pred , class _Alloc >
1835
+ struct __container_traits <unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc> > {
1836
+ // http://eel.is/c++draft/unord.req.except#2
1837
+ // For unordered associative containers, if an exception is thrown by any operation
1838
+ // other than the container's hash function from within an insert or emplace function
1839
+ // inserting a single element, the insertion has no effect.
1840
+ using __emplacement_has_strong_exception_safety_guarantee = __nothrow_invokable<_Hash, const _Key&>;
1841
+ };
1842
+
1833
1843
template <class _Key ,
1834
1844
class _Tp ,
1835
1845
class _Hash = hash<_Key>,
@@ -2520,6 +2530,15 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const unordered_multimap<_Key, _Tp,
2520
2530
2521
2531
#endif
2522
2532
2533
+ template <class _Key , class _Tp , class _Hash , class _Pred , class _Alloc >
2534
+ struct __container_traits <unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc> > {
2535
+ // http://eel.is/c++draft/unord.req.except#2
2536
+ // For unordered associative containers, if an exception is thrown by any operation
2537
+ // other than the container's hash function from within an insert or emplace function
2538
+ // inserting a single element, the insertion has no effect.
2539
+ using __emplacement_has_strong_exception_safety_guarantee = __nothrow_invokable<_Hash, const _Key&>;
2540
+ };
2541
+
2523
2542
_LIBCPP_END_NAMESPACE_STD
2524
2543
2525
2544
#if _LIBCPP_STD_VER >= 17
0 commit comments