    #define INVOKE(hof, func, arg) \
       hof([](const decltype(arg)& arg_){return func(arg_);}, arg);
   
    // This function mimics the signature of QtCollector::run for testing
    template <typename Functor, typename Arg1>
    auto QtConcurrent_run(Functor functor, const Arg1 &arg1)
          -> decltype(functor(arg1))
    {
          return functor(arg1);
    }

    #include <iostream>
    
    int f(int x) { std::cout << "int" << " " << x << std::endl; return x; }
    double f(double x) { std::cout << "double" << " " << x << std::endl; return x; }
    
    int main() {
      INVOKE(QtConcurrent_run, f, 3);
      INVOKE(QtConcurrent_run, f, 3.14);
      INVOKE(QtConcurrent_run, f, '3');
      return 0;
    }
