-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<expected>
: Make copy/move assignment operators of expected
propagate triviality
#4271
<expected>
: Make copy/move assignment operators of expected
propagate triviality
#4271
Conversation
As I mentioned on Discord, the Also, |
In practice, there are (1) no types for which copy operations are trivial but moves are not, (2) no types for which assignment is trivial but construction is not, and (3) no types for which some copy or move operation is trivial but destruction is not. It's sufficient to test five cases:
|
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Thanks for this highly nontrivial enhancement! 😹 🎉 🚀 |
The conditions for triviality should be consistent with
optional
andvariant
(see WG21-P0602R4). I've tried to submit an LWG issue for this, but I believe we can conformingly do this without changing the standard wording. Edit: the issue is now LWG-4026.The changes are also being made in libc++, see LLVM-74768.
Old test coverage was a bit crazy
More than 1000 function template specializations are instantiated. But I have no good idea to reduce the instantiation.
Edit: reduced the cases from 32×32 to 6×6.