r264786 - in /trunk/libstdc++-v3: ChangeLog inc...
redi@gcc.gnu.org
redi@gcc.gnu.org
Tue Oct 2 14:00:00 GMT 2018
Author: redi
Date: Tue Oct 2 14:00:50 2018
New Revision: 264786
URL: https://gcc.gnu.org/viewcvs?rev=264786&root=gcc&view=rev
Log:
Avoid redundant runtime checks in std::visit
Calling std::get will check some static assertions and also do a runtime
check for a valid index before calling __detail::__variant::__get. The
std::visit function already handles the case where any variant has an
invalid index, so __get can be used directly in __visit_invoke.
* include/std/variant (__gen_vtable_impl::__visit_invoke): Call __get
directly instead of get, as caller ensures correct index is used.
(holds_alternative, get, get_if): Remove redundant inline specifiers.
(_VARIANT_RELATION_FUNCTION_TEMPLATE): Likewise.
Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/std/variant
More information about the Libstdc++-cvs
mailing list