From e8308aaf329b26d07e36a0c1b0f97073a4270eb9 Mon Sep 17 00:00:00 2001 From: Sven Over Date: Fri, 12 Aug 2016 14:18:46 -0700 Subject: [PATCH] fix folly::NotificationQueue for move-only value types Summary: folly::NotificationQueue::tryConsume did not compile for move-only types such as folly::Function. This diff fixes that. Reviewed By: andriigrynenko Differential Revision: D3711406 fbshipit-source-id: a52eba3eb31743165e4726f830f2a38d241f25a5 --- folly/io/async/NotificationQueue.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/folly/io/async/NotificationQueue.h b/folly/io/async/NotificationQueue.h index 625d64ed..2baa2ba2 100644 --- a/folly/io/async/NotificationQueue.h +++ b/folly/io/async/NotificationQueue.h @@ -422,9 +422,9 @@ class NotificationQueue { return false; } - auto data = std::move(queue_.front()); - result = data.first; - RequestContext::setContext(data.second); + auto& data = queue_.front(); + result = std::move(data.first); + RequestContext::setContext(std::move(data.second)); queue_.pop_front(); -- 2.34.1