[libcxx-commits] [libcxx] Speed up std::invoke() compile times (~60%-85% reduction) (PR #213403)

via libcxx-commits libcxx-commits at lists.llvm.org
Mon Nov 2 07:54:07 PST 2026


================
@@ -392,7 +416,7 @@ template <class _Fn, class... _Args>
 struct _LIBCPP_NO_SPECIALIZATIONS invoke_result : __invoke_result<_Fn, _Args...> {};
 
 template <class _Fn, class... _Args>
-using invoke_result_t = __invoke_result_t<_Fn, _Args...>;
+using invoke_result_t = typename invoke_result<_Fn, _Args...>::type;
----------------
higher-performance wrote:

@philnik777 I'm confused... putting the workaround here was your choice, not mine: #151028

Moreover, any caller using `std::__invoke` would be subject to this bug, so I'm not sure this is the wrong place to put it. It just so happens that we're only aware of `std::variant` dealing with this issue right now, but we haven't audited all the callers to see if this problem might occur for them too.

Could we please move this PR forward and not block it on such issues...? It'd been held up for a few months now.

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


More information about the libcxx-commits mailing list