ReactiveX / RxCpp

Reactive Extensions for C++
Apache License 2.0
3.03k stars 390 forks source link

Fix std::result_of removed in C++20 #551

Closed Asaaj closed 3 years ago

Asaaj commented 3 years ago

Fix for #530, intended to be as minimal as possible. Further testing is required, but I wanted to get this in for discussion.

Asaaj commented 3 years ago

I wanted a simpler change than #545, which apparently failed. This seems safer to me

Asaaj commented 3 years ago

I've never worked with AppVeyor before, but is it reasonably straightforward to get it building with VS2019? Or is RxCpp not claiming to support that version of VS? I can guess what changes are required in appveyor.yml, but I'm not sure the protocol here.

Asaaj commented 3 years ago

@kirkshoop with C++20 approaching completion on all major compilers, it would be great to get this fix tested and released soon so this library doesn't gate those who want to upgrade (myself included).

serg06 commented 3 years ago

@kirkshoop please 🙏 my C++20 project needs this

serg06 commented 3 years ago

Update: Here's a quick workaround, before importing rx.hpp have this:

namespace std {
   template <class> struct result_of;
   template <class F, class... TN> struct result_of<F(TN...)>
   {
      using type = std::invoke_result_t<F, TN...>;
   };
}
serg06 commented 3 years ago

❤️

david-alvarez-rosa commented 4 months ago

Thanks!!