msvc_cpp20.patch 788 B

123456789101112131415161718
  1. diff --git a/include/base/cef_template_util.h b/include/base/cef_template_util.h
  2. index 02e2ead06..a77cf643a 100644
  3. --- a/include/base/cef_template_util.h
  4. +++ b/include/base/cef_template_util.h
  5. @@ -276,8 +276,13 @@ struct negation : bool_constant<!static_cast<bool>(B::value)> {};
  6. // References:
  7. // [1] https://en.cppreference.com/w/cpp/types/result_of
  8. // [2] https://wg21.link/meta.trans.other#lib:invoke_result
  9. +#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
  10. +template <typename Functor, typename... Args>
  11. +using invoke_result = std::invoke_result<Functor, Args...>;
  12. +#else
  13. template <typename Functor, typename... Args>
  14. using invoke_result = std::result_of<Functor && (Args && ...)>;
  15. +#endif
  16. // Implementation of C++17's std::invoke_result_t.
  17. //