[libcxx-commits] [libcxx] [libc++] Implement N4258(Cleaning-up noexcept in the Library) (PR #120312)
A. Jiang via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Dec 17 17:16:19 PST 2024
================
@@ -772,9 +772,16 @@ public:
_LIBCPP_HIDE_FROM_ABI __hash_table& operator=(const __hash_table& __u);
_LIBCPP_HIDE_FROM_ABI __hash_table& operator=(__hash_table&& __u)
- _NOEXCEPT_(__node_traits::propagate_on_container_move_assignment::value&&
- is_nothrow_move_assignable<__node_allocator>::value&& is_nothrow_move_assignable<hasher>::value&&
- is_nothrow_move_assignable<key_equal>::value);
+#ifndef _LIBCPP_CXX03_LANG
+ noexcept(is_nothrow_move_assignable<hasher>::value && is_nothrow_move_assignable<key_equal>::value &&
+ ((__node_traits::propagate_on_container_move_assignment::value &&
+ is_nothrow_move_assignable<__node_allocator>::value)
----------------
frederick-vs-ja wrote:
Do we want `is_nothrow_move_assignable<Alloc>` to affect the exception specifications (which potentially weakens exception specifications)?
Note that [[allocator.requirements.general]/84](https://eel.is/c++draft/allocator.requirements.general#84) requires that if the allocator is move-assigned, the operation must not throw an exception, even if the move assignment is potentially throwing.
https://github.com/llvm/llvm-project/pull/120312
More information about the libcxx-commits
mailing list