no_result_of.patch 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. --- contrib/libs/apache/arrow/cpp/src/arrow/result.h (2e0006a95f0ad665eca5b48386842a8a0354061f)
  2. +++ contrib/libs/apache/arrow/cpp/src/arrow/result.h (working tree)
  3. @@ -385,7 +385,7 @@ class ARROW_MUST_USE_TYPE Result : public util::EqualityComparable<Result<T>> {
  4. /// Apply a function to the internally stored value to produce a new result or propagate
  5. /// the stored error.
  6. template <typename M>
  7. - typename EnsureResult<typename std::result_of<M && (T)>::type>::type Map(M&& m) && {
  8. + typename EnsureResult<decltype(std::declval<M&&>()(std::declval<T&&>()))>::type Map(M&& m) && {
  9. if (!ok()) {
  10. return status();
  11. }
  12. @@ -395,7 +395,7 @@ class ARROW_MUST_USE_TYPE Result : public util::EqualityComparable<Result<T>> {
  13. /// Apply a function to the internally stored value to produce a new result or propagate
  14. /// the stored error.
  15. template <typename M>
  16. - typename EnsureResult<typename std::result_of<M && (const T&)>::type>::type Map(
  17. + typename EnsureResult<decltype(std::declval<M&&>()(std::declval<const T&>()))>::type Map(
  18. M&& m) const& {
  19. if (!ok()) {
  20. return status();
  21. --- contrib/libs/apache/arrow/cpp/src/arrow/util/bitmap_generate.h (2e0006a95f0ad665eca5b48386842a8a0354061f)
  22. +++ contrib/libs/apache/arrow/cpp/src/arrow/util/bitmap_generate.h (working tree)
  23. @@ -62,7 +62,7 @@ void GenerateBits(uint8_t* bitmap, int64_t start_offset, int64_t length, Generat
  24. template <class Generator>
  25. void GenerateBitsUnrolled(uint8_t* bitmap, int64_t start_offset, int64_t length,
  26. Generator&& g) {
  27. - static_assert(std::is_same<typename std::result_of<Generator && ()>::type, bool>::value,
  28. + static_assert(std::is_same<decltype(std::declval<Generator>()()), bool>::value,
  29. "Functor passed to GenerateBitsUnrolled must return bool");
  30. if (length == 0) {
  31. --- contrib/libs/apache/arrow/cpp/src/arrow/util/functional.h (2e0006a95f0ad665eca5b48386842a8a0354061f)
  32. +++ contrib/libs/apache/arrow/cpp/src/arrow/util/functional.h (working tree)
  33. @@ -129,7 +129,7 @@ class FnOnce<R(A...)> {
  34. template <typename Fn,
  35. typename = typename std::enable_if<std::is_convertible<
  36. - typename std::result_of<Fn && (A...)>::type, R>::value>::type>
  37. + decltype(std::declval<Fn&&>()(std::declval<A>()...)), R>::value>::type>
  38. FnOnce(Fn fn) : impl_(new FnImpl<Fn>(std::move(fn))) { // NOLINT runtime/explicit
  39. }
  40. --- contrib/libs/apache/arrow/cpp/src/arrow/util/future.h (2e0006a95f0ad665eca5b48386842a8a0354061f)
  41. +++ contrib/libs/apache/arrow/cpp/src/arrow/util/future.h (working tree)
  42. @@ -47,8 +47,17 @@ struct is_future : std::false_type {};
  43. template <typename T>
  44. struct is_future<Future<T>> : std::true_type {};
  45. +template <typename Signature, typename Enable = void>
  46. +struct result_of;
  47. +
  48. +template <typename Fn, typename... A>
  49. +struct result_of<Fn(A...),
  50. + std::void_t<decltype(std::declval<Fn>()(std::declval<A>()...))>> {
  51. + using type = decltype(std::declval<Fn>()(std::declval<A>()...));
  52. +};
  53. +
  54. template <typename Signature>
  55. -using result_of_t = typename std::result_of<Signature>::type;
  56. +using result_of_t = typename result_of<Signature>::type;
  57. // Helper to find the synchronous counterpart for a Future
  58. template <typename T>