[libcxx-commits] [libcxx] [libc++] LWG4025: Move assignment operator of `std::expected<cv void, E>` should not be conditionally deleted (PR #109363)

via libcxx-commits libcxx-commits at lists.llvm.org
Thu Sep 19 19:21:39 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Xiaoyang Liu (xiaoyang-sde)

<details>
<summary>Changes</summary>

## Introduction

This patch implements LWG4025: Move assignment operator of `std::expected<cv void, E>` should not be conditionally deleted.

## Reference

- [[expected.void.assign]](https://eel.is/c++draft/expected.void.assign)
- [LWG4025](https://cplusplus.github.io/LWG/issue4025)

Closes #<!-- -->105324


---
Full diff: https://github.com/llvm/llvm-project/pull/109363.diff


1 Files Affected:

- (modified) libcxx/include/__expected/expected.h (-2) 


``````````diff
diff --git a/libcxx/include/__expected/expected.h b/libcxx/include/__expected/expected.h
index f4ad455a19ea5e..e04e17d1ebe698 100644
--- a/libcxx/include/__expected/expected.h
+++ b/libcxx/include/__expected/expected.h
@@ -1493,8 +1493,6 @@ class expected<_Tp, _Err> : private __expected_void_base<_Err> {
     return *this;
   }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr expected& operator=(expected&&) = delete;
-
   _LIBCPP_HIDE_FROM_ABI constexpr expected&
   operator=(expected&& __rhs) noexcept(is_nothrow_move_assignable_v<_Err> && is_nothrow_move_constructible_v<_Err>)
     requires(is_move_assignable_v<_Err> && is_move_constructible_v<_Err>)

``````````

</details>


https://github.com/llvm/llvm-project/pull/109363


More information about the libcxx-commits mailing list