Changes to std::variant to reduce code size
authorJonathan Wakely <jwakely@redhat.com>
Thu, 16 May 2019 20:30:27 +0000 (21:30 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 16 May 2019 20:30:27 +0000 (21:30 +0100)
commitb62dcd16aa033968075f19631c757bb39a16ef92
tree93b75bd835ebd1d7f85113f2a4f6334b4d87f0de
parent5120e0d8d48f4590a275e60565de6c5a4e772fc1
Changes to std::variant to reduce code size

* include/std/variant (_Variant_storage<false, _Types...>::_M_reset):
Replace raw visitation with a runtime check for the valueless state
and a non-raw visitor.
(_Variant_storage<false, _Types...>::_M_reset_impl): Remove.
(variant::index()): Remove branch.
(variant::swap(variant&)): Use valueless_by_exception() instead of
comparing the index to variant_npos, and add likelihood attribute.

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