[compiler-rt] [clang] [lld] [openmp] [libc] [llvm] [lldb] [libcxx] [flang] [clang-tools-extra] [libc++][variant] P2637R3: Member `visit` (`std::variant`) (PR #76447)

Mark de Wever via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 20 11:21:57 PST 2024


================
@@ -1130,6 +1137,19 @@ using __best_match_t = typename invoke_result_t<_MakeOverloads<_Types...>, _Tp,
 
 } // namespace __variant_detail
 
+template < class _Visitor, class... _Vs, typename = void_t<decltype(std::__as_variant(std::declval<_Vs>()))...> >
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr decltype(auto)
+visit(_Visitor&& __visitor, _Vs&&... __vs);
+
+#  if _LIBCPP_STD_VER >= 20
+template < class _Rp,
+           class _Visitor,
+           class... _Vs,
+           typename = void_t<decltype(std::__as_variant(std::declval<_Vs>()))...> >
----------------
mordante wrote:

```suggestion
           typename = void_t<decltype(std::__as_variant(std::declval<_Vs>()))...>>
```

https://github.com/llvm/llvm-project/pull/76447


More information about the cfe-commits mailing list