From 8d9bc5cc022bee4a06201c7c5a1dec2b73697f5f Mon Sep 17 00:00:00 2001 From: Rasmus Munk Larsen Date: Thu, 23 Aug 2018 13:06:39 -0700 Subject: [PATCH] Fix g++ compilation. --- unsupported/Eigen/CXX11/src/ThreadPool/NonBlockingThreadPool.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unsupported/Eigen/CXX11/src/ThreadPool/NonBlockingThreadPool.h b/unsupported/Eigen/CXX11/src/ThreadPool/NonBlockingThreadPool.h index 1cb63bcfa..60a0c9fb6 100644 --- a/unsupported/Eigen/CXX11/src/ThreadPool/NonBlockingThreadPool.h +++ b/unsupported/Eigen/CXX11/src/ThreadPool/NonBlockingThreadPool.h @@ -180,8 +180,9 @@ class ThreadPoolTempl : public Eigen::ThreadPoolInterface { // Main worker thread loop. void WorkerLoop(int thread_id) { #ifndef EIGEN_THREAD_LOCAL + std::unique_ptr new_pt(new PerThread()); per_thread_map_mutex_.lock(); - eigen_assert(per_thread_map_.emplace(GlobalThreadIdHash(), new PerThread()).second); + eigen_assert(per_thread_map_.emplace(GlobalThreadIdHash(), std::move(new_pt)).second); per_thread_map_mutex_.unlock(); init_barrier_->Notify(); init_barrier_->Wait();