[libcxx-commits] [PATCH] D95372: Follow up build fix for P0655R1 visit<R>: Explicit Return Type for visit

Ruslan Arutyunyan via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jan 25 09:20:31 PST 2021


rarutyun created this revision.
rarutyun added reviewers: ldionne, mpark, libc++.
rarutyun added a project: libc++.
rarutyun requested review of this revision.
Herald added a subscriber: libcxx-commits.
Herald added 1 blocking reviewer(s): libc++.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D95372

Files:
  libcxx/include/variant


Index: libcxx/include/variant
===================================================================
--- libcxx/include/variant
+++ libcxx/include/variant
@@ -1635,10 +1635,10 @@
       __lhs.index(), __convert_to_bool<greater_equal<>>{}, __lhs, __rhs);
 }
 
-template <class _Visitor, class... _Vs>
+template <class... _Vs>
 inline _LIBCPP_INLINE_VISIBILITY
 _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS
-constexpr void __throw_if_valueless(_Visitor&& __visitor, _Vs&&... __vs) {
+constexpr void __throw_if_valueless(_Vs&&... __vs) {
   const bool __valueless = (... || __vs.valueless_by_exception());
   if (__valueless) {
       __throw_bad_variant_access();
@@ -1650,8 +1650,7 @@
 _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS
 constexpr decltype(auto) visit(_Visitor&& __visitor, _Vs&&... __vs) {
   using __variant_detail::__visitation::__variant;
-  _VSTD::__throw_if_valueless(_VSTD::forward<_Visitor>(__visitor),
-                              _VSTD::forward<_Vs>(__vs)...);
+  _VSTD::__throw_if_valueless(_VSTD::forward<_Vs>(__vs)...);
   return __variant::__visit_value(_VSTD::forward<_Visitor>(__visitor),
                                   _VSTD::forward<_Vs>(__vs)...);
 }
@@ -1662,8 +1661,7 @@
 _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS
 constexpr _Rp visit(_Visitor&& __visitor, _Vs&&... __vs) {
   using __variant_detail::__visitation::__variant;
-  _VSTD::__throw_if_valueless(_VSTD::forward<_Visitor>(__visitor),
-                              _VSTD::forward<_Vs>(__vs)...);
+  _VSTD::__throw_if_valueless(_VSTD::forward<_Vs>(__vs)...);
   return __variant::__visit_value<_Rp>(_VSTD::forward<_Visitor>(__visitor),
                                        _VSTD::forward<_Vs>(__vs)...);
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95372.319034.patch
Type: text/x-patch
Size: 1709 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210125/89079027/attachment-0001.bin>


More information about the libcxx-commits mailing list