Use single-visitation in variant assignment and swap and relops.
authorVille Voutilainen <ville.voutilainen@gmail.com>
Mon, 1 Apr 2019 13:57:41 +0000 (16:57 +0300)
committerVille Voutilainen <ville@gcc.gnu.org>
Mon, 1 Apr 2019 13:57:41 +0000 (16:57 +0300)
commitf1ba6c5a51936ac9065789b1fdb77f4e35f90efd
tree7c62957207e8e4e859e378353dc277ddb6d8ef9d
parente37240b0b556c2bcdf94b0a84ff798cd4bd5a316
Use single-visitation in variant assignment and swap and relops.

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.
(__visit_with_index): Likewise.
(_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.
(relops): Do single-visitation with an index visitor.
(swap): Likewise.
(__visitor_result_type): New.

From-SVN: r270056
libstdc++-v3/ChangeLog
libstdc++-v3/include/std/variant