From ef011843b0215b29f62f4527cec88661510108d7 Mon Sep 17 00:00:00 2001 From: Bruno Goncalves Date: Fri, 16 Oct 2015 19:03:22 -0700 Subject: [PATCH] Remove boost dependency from folly/ProducerConsumerQueue.h Summary: Boost is great, but c++11 incorporate some of their stuffs, and classes like ProducerConsumerQueue don't need it anymore. Closes https://github.com/facebook/folly/pull/321 Reviewed By: fredemmott, yfeldblum Differential Revision: D2519081 fb-gh-sync-id: b138a5af4662d1e7ef5e0823cf4001880ee02456 --- folly/ProducerConsumerQueue.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/folly/ProducerConsumerQueue.h b/folly/ProducerConsumerQueue.h index 7d2c05bf..fedc2c74 100644 --- a/folly/ProducerConsumerQueue.h +++ b/folly/ProducerConsumerQueue.h @@ -26,8 +26,6 @@ #include #include #include -#include -#include namespace folly { @@ -36,9 +34,12 @@ namespace folly { * without locks. */ template -struct ProducerConsumerQueue : private boost::noncopyable { +struct ProducerConsumerQueue { typedef T value_type; + ProducerConsumerQueue(const ProducerConsumerQueue&) = delete; + ProducerConsumerQueue& operator = (const ProducerConsumerQueue&) = delete; + // size must be >= 2. // // Also, note that the number of usable slots in the queue at any @@ -60,7 +61,7 @@ struct ProducerConsumerQueue : private boost::noncopyable { // We need to destruct anything that may still exist in our queue. // (No real synchronization needed at destructor time: only one // thread can be doing this.) - if (!boost::has_trivial_destructor::value) { + if (!std::is_trivially_destructible::value) { size_t read = readIndex_; size_t end = writeIndex_; while (read != end) { -- 2.34.1