[v3 PATCH] Use single-visitation in variant assignment and swap.

Ville Voutilainen ville.voutilainen@gmail.com
Sat Mar 30 18:00:00 GMT 2019


This patch makes assignments correct, because they need to
match indices instead of types. In addition, we cut down the
codegen size. The symbols are longer than before, the the amount
of them is roughly the same, so there's no longer an explosion
in their amount.

Relops are the last bit in these fixes, I'll fix them during the weekend.

2019-03-30  Ville Voutilainen  <ville.voutilainen@gmail.com>

    Use single-visitation in variant assignment and swap.
    Also use indices instead of types when checking whether
    variants hold the same thing.
    * include/std/variant (__do_visit): Add a template parameter
    for index visitation, invoke with indices if index visitation
    is used.
    (__variant_idx_cookie): New.
    (_Copy_assign_base::operator=): Do single-visitation with
    an index visitor.
    (_Move_assign_base::operator=): Likewise.
    (_Extra_visit_slot_needed): Adjust.
    (__visit_invoke): Call with indices if it's an index visitor.
    (swap): Do single-visitation with an index visitor.
    (__visitor_result_type): New.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: variant-single-visit.diff
Type: text/x-patch
Size: 9432 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20190330/4f44ccca/attachment.bin>


More information about the Libstdc++ mailing list