News for hackers. Stuff that matters.
Re:Rust vs. Go by gpderetta on Wednesday January 18, 2017 @06:19PM (#13431432)
Equivalent [1] C++14 for comparison:

   template<class F, class A>
   auto apply(F f, A a) {
      return [f=std::move(f), a=std::move(a)](auto&& b) {
        return f(std::forward<dectlype(b)>(b))(a);
      }
   }
The forward<decltype> is an abomination and is really in need of a language based solution, but otherwise is fairly straightforward.

[1] No type checking of the definition of course, only of instantiations. On the plus side, the returned function is polymorphic and can be called for all Bs that f can be called.

There are no comments on this comment yet.