Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83268 - trunk/boost/lockfree
From: tim_at_[hidden]
Date: 2013-03-03 06:32:57


Author: timblechmann
Date: 2013-03-03 06:32:56 EST (Sun, 03 Mar 2013)
New Revision: 83268
URL: http://svn.boost.org/trac/boost/changeset/83268

Log:
lockfree: cleanup - use deleted functions if available
Text files modified:
   trunk/boost/lockfree/queue.hpp | 16 ++++++++++++----
   trunk/boost/lockfree/spsc_queue.hpp | 14 ++++++++++++--
   trunk/boost/lockfree/stack.hpp | 14 ++++++++++++--
   3 files changed, 36 insertions(+), 8 deletions(-)

Modified: trunk/boost/lockfree/queue.hpp
==============================================================================
--- trunk/boost/lockfree/queue.hpp (original)
+++ trunk/boost/lockfree/queue.hpp 2013-03-03 06:32:56 EST (Sun, 03 Mar 2013)
@@ -11,10 +11,10 @@
 #ifndef BOOST_LOCKFREE_FIFO_HPP_INCLUDED
 #define BOOST_LOCKFREE_FIFO_HPP_INCLUDED
 
-#include <memory> /* std::auto_ptr */
-
 #include <boost/assert.hpp>
+#ifdef BOOST_NO_CXX11_DELETED_FUNCTIONS
 #include <boost/noncopyable.hpp>
+#endif
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/has_trivial_assign.hpp>
 #include <boost/type_traits/has_trivial_destructor.hpp>
@@ -69,8 +69,10 @@
 #else
 template <typename T, ...Options>
 #endif
-class queue:
- boost::noncopyable
+class queue
+#ifdef BOOST_NO_CXX11_DELETED_FUNCTIONS
+ : boost::noncopyable
+#endif
 {
 private:
 #ifndef BOOST_DOXYGEN_INVOKED
@@ -137,6 +139,12 @@
 
 #endif
 
+#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS
+ queue(queue const &) = delete;
+ queue(queue &&) = delete;
+ const queue& operator=( const queue& ) = delete;
+#endif
+
 public:
     typedef T value_type;
     typedef typename implementation_defined::allocator allocator;

Modified: trunk/boost/lockfree/spsc_queue.hpp
==============================================================================
--- trunk/boost/lockfree/spsc_queue.hpp (original)
+++ trunk/boost/lockfree/spsc_queue.hpp 2013-03-03 06:32:56 EST (Sun, 03 Mar 2013)
@@ -14,7 +14,9 @@
 
 #include <boost/array.hpp>
 #include <boost/assert.hpp>
+#ifdef BOOST_NO_CXX11_DELETED_FUNCTIONS
 #include <boost/noncopyable.hpp>
+#endif
 #include <boost/static_assert.hpp>
 
 #include <boost/lockfree/detail/atomic.hpp>
@@ -32,8 +34,10 @@
> ringbuffer_signature;
 
 template <typename T>
-class ringbuffer_base:
- boost::noncopyable
+class ringbuffer_base
+#ifdef BOOST_NO_CXX11_DELETED_FUNCTIONS
+ : boost::noncopyable
+#endif
 {
 #ifndef BOOST_DOXYGEN_INVOKED
     typedef std::size_t size_t;
@@ -42,6 +46,12 @@
     char padding1[padding_size]; /* force read_index and write_index to different cache lines */
     atomic<size_t> read_index_;
 
+#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS
+ ringbuffer_base(ringbuffer_base const &) = delete;
+ ringbuffer_base(ringbuffer_base &&) = delete;
+ const ringbuffer_base& operator=( const ringbuffer_base& ) = delete;
+#endif
+
 protected:
     ringbuffer_base(void):
         write_index_(0), read_index_(0)

Modified: trunk/boost/lockfree/stack.hpp
==============================================================================
--- trunk/boost/lockfree/stack.hpp (original)
+++ trunk/boost/lockfree/stack.hpp 2013-03-03 06:32:56 EST (Sun, 03 Mar 2013)
@@ -10,7 +10,9 @@
 #include <boost/assert.hpp>
 #include <boost/checked_delete.hpp>
 #include <boost/integer_traits.hpp>
+#ifdef BOOST_NO_CXX11_DELETED_FUNCTIONS
 #include <boost/noncopyable.hpp>
+#endif
 #include <boost/static_assert.hpp>
 #include <boost/tuple/tuple.hpp>
 #include <boost/type_traits/has_trivial_assign.hpp>
@@ -63,8 +65,10 @@
 #else
 template <typename T, ...Options>
 #endif
-class stack:
- boost::noncopyable
+class stack
+#ifdef BOOST_NO_CXX11_DELETED_FUNCTIONS
+ : boost::noncopyable
+#endif
 {
 private:
 #ifndef BOOST_DOXYGEN_INVOKED
@@ -108,6 +112,12 @@
 
 #endif
 
+#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS
+ stack(stack const &) = delete;
+ stack(stack &&) = delete;
+ const stack& operator=( const stack& ) = delete;
+#endif
+
 public:
     typedef T value_type;
     typedef typename implementation_defined::allocator allocator;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk