Implement LWG-4025 #28
Conversation
Signed-off-by: Yuming He <ComixHe1895@outlook.com>
Signed-off-by: Yuming He <ComixHe1895@outlook.com>
Signed-off-by: Yuming He <ComixHe1895@outlook.com>
|
I have some good news: we can actually achieve both—implementing LWG-4026 without breaking the custom SFINAE scenario you mentioned. To verify this, we can simply keep the test additions (though the custom-SFINAE test case will need a minor adjustment). There is no need to modify the implementation itself; running the tests directly will confirm this. :) I appreciate the tests you've provided. Although the core implementation doesn't need to be updated, these test cases remain valuable for future regression testing, and I would very much like to keep them in the repository. As a supplementary note regarding my understanding of LWG-4025: the reason the standard's resolution only targets With this symmetry in mind, it would be even better if the test cases could be expanded to cover both Thanks again for the contribution and the constructive discussion. |
Implements LWG-4025 by omitting operator=(move_assign_base&&) for expected<void, E> when E is not movable, letting the defaulted move assignment fall back to copy.
This produces identical trait results to a conforming C++23 implementation, but is a structural deviation: the operator exists (dispatching to copy) where the standard excludes it, detectable only via custom SFINAE.
The alternative (SFINAE-constraining the operator) would break triviality (LWG-4026) for the common case. Would this approach be acceptable?