[v3 PATCH] Don't revisit a variant we are already visiting.
Ville Voutilainen
ville.voutilainen@gmail.com
Thu Mar 28 13:07:00 GMT 2019
This shaves off some unnecessary codegen. In the assignment
operators and swap, we are already visiting the rhs, so we shouldn't
visit it again to get to its guts, we already have them in-hand.
2019-03-28 Ville Voutilainen <ville.voutilainen@gmail.com>
Don't revisit a variant we are already visiting.
* include/std/variant (__variant_construct_single): New.
(__variant_construct): Use it.
(_M_destructive_move): Likewise, turn into a template.
(_M_destructive_copy): Likewise.
(_Copy_assign_base::operator=): Adjust.
(_Move_assign_base::operator=): Likewise.
(swap): Likewise.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: no-variant-revisit.diff
Type: text/x-patch
Size: 6081 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20190328/7adb7c7c/attachment.bin>
More information about the Libstdc++
mailing list