示例#1
0
 void post(F fun) {
   struct impl : runnable {
     F f;
     impl(F&& mf) : f(std::move(mf)) { }
     void run() override {
       f();
     }
   };
   dispatch_runnable(make_counted<impl>(std::move(fun)));
 }
示例#2
0
 void post(F fun) {
   struct impl : runnable {
     F f;
     impl(F&& mf) : f(std::move(mf)) { }
     void run() override {
       f();
     }
   };
   dispatch_runnable(runnable_ptr{detail::memory::create<impl>(std::move(fun))});
 }