================ @@ -2596,6 +2596,15 @@ template <typename T> using has_sizeof = decltype(sizeof(T)); template <typename T> constexpr bool is_incomplete_v = !is_detected<detail::has_sizeof, T>::value; +//===----------------------------------------------------------------------===// +// Extra additions to <variant> +//===----------------------------------------------------------------------===// + +template <class... Ts> struct overloaded : Ts... { + using Ts::operator()...; +}; +template <class... Ts> overloaded(Ts...) -> overloaded<Ts...>; + ---------------- Bigcheese wrote:
I just played around with it in [compiler explorer](https://godbolt.org/z/c7baxEjWP) and I'm not sure why it was implemented that way. Aggregate initialization just does the right thing. It does require using `{}` instead of `()` (until C++20), but I think that's the only difference. I'll just remove it from this patch and if we want to change makeVisitor that can happen separately. https://github.com/llvm/llvm-project/pull/119740 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits