Use rvalue reference in thread_pool::post_task
[deliverable/binutils-gdb.git] / gdbsupport / thread-pool.cc
index cd5e11673a925d408ab9e92afa833e277f629538..2bb75cc9cef4b6ab42e0779106063aa9e53fb38a 100644 (file)
@@ -130,9 +130,9 @@ thread_pool::set_thread_count (size_t num_threads)
 }
 
 std::future<void>
-thread_pool::post_task (std::function<void ()> func)
+thread_pool::post_task (std::function<void ()> &&func)
 {
-  std::packaged_task<void ()> t (func);
+  std::packaged_task<void ()> t (std::move (func));
   std::future<void> f = t.get_future ();
 
   if (m_thread_count == 0)
This page took 0.032599 seconds and 4 git commands to generate.