]> git.ipfire.org Git - thirdparty/gcc.git/commit
Changes to std::variant to reduce code size
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 May 2019 20:30:27 +0000 (20:30 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 May 2019 20:30:27 +0000 (20:30 +0000)
commitfacad3f4e8aea3036336cf3ecb041497b093b139
tree93b75bd835ebd1d7f85113f2a4f6334b4d87f0de
parentb3cab549c1727eda10b1d7cdbf8adb816f9d03f6
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@271295 138bc75d-0d04-0410-961f-82ee72b054a4
libstdc++-v3/ChangeLog
libstdc++-v3/include/std/variant