Remove cds/details/noncopyable.h, use C++11 '=delete ctor' instead
authorkhizmax <khizmax@gmail.com>
Wed, 1 Oct 2014 13:40:17 +0000 (17:40 +0400)
committerkhizmax <khizmax@gmail.com>
Wed, 1 Oct 2014 13:40:17 +0000 (17:40 +0400)
cds/details/noncopyable.h [deleted file]
cds/gc/hrc/hrc.h
cds/gc/hzp/hzp.h
cds/gc/ptb/ptb.h
cds/lock/spinlock.h
projects/Win/vc12/cds.vcxproj
projects/Win/vc12/cds.vcxproj.filters

diff --git a/cds/details/noncopyable.h b/cds/details/noncopyable.h
deleted file mode 100644 (file)
index c2983a9..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-//$$CDS-header$$
-
-#ifndef __CDS_DETAILS_NONCOPYABLE_H
-#define __CDS_DETAILS_NONCOPYABLE_H
-
-#include <boost/noncopyable.hpp>
-
-//@cond
-namespace cds { namespace details {
-    using boost::noncopyable;
-}}  // namespace cds::details
-//@endcond
-
-#endif // __CDS_DETAILS_NONCOPYABLE_H
-
index 96cb160673893746afcef2edafa5cbc261d65cd8..4ba20e744f41822cc9e88c36e8ded510c5ad28c2 100644 (file)
@@ -17,8 +17,6 @@
 
 #include <cds/gc/hzp/details/hp_alloc.h>
 
-#include <cds/details/noncopyable.h>
-
 #if CDS_COMPILER == CDS_COMPILER_MSVC
 #   pragma warning(push)
 // warning C4251: 'cds::gc::hzp::GarbageCollector::m_pListHead' : class 'cds::cxx11_atomic::atomic<T>'
@@ -463,7 +461,7 @@ namespace cds { namespace gc {
             on the start of each thread that uses HRC GC. Before terminating the thread linked to HRC GC it is necessary to call
             cds::threading \p Manager::detachThread().
         */
-        class ThreadGC: cds::details::noncopyable
+        class ThreadGC
         {
             GarbageCollector&               m_gc    ; ///< master garbage collector
             details::thread_descriptor *    m_pDesc ; ///< descriptor of GC data for the thread
@@ -476,6 +474,9 @@ namespace cds { namespace gc {
                 : m_gc( GarbageCollector::instance() )
                 , m_pDesc( nullptr )
             {}
+
+            ThreadGC( ThreadGC const& ) = delete;
+
             ~ThreadGC()
             {
                 fini();
index 92eb84d3d471ff0cf515dbb9e29c9fccc331954d..26cf409a4454bcc5a68619a28b2771cf9ec74303 100644 (file)
@@ -3,17 +3,14 @@
 #ifndef __CDS_GC_HZP_HZP_H
 #define __CDS_GC_HZP_HZP_H
 
+#include <vector>
 #include <cds/cxx11_atomic.h>
 #include <cds/os/thread.h>
 #include <cds/gc/exception.h>
-
 #include <cds/gc/hzp/details/hp_fwd.h>
 #include <cds/gc/hzp/details/hp_alloc.h>
 #include <cds/gc/hzp/details/hp_retired.h>
 
-#include <vector>
-#include <cds/details/noncopyable.h>
-
 #if CDS_COMPILER == CDS_COMPILER_MSVC
 #   pragma warning(push)
     // warning C4251: 'cds::gc::hzp::GarbageCollector::m_pListHead' : class 'cds::cxx11_atomic::atomic<T>'
@@ -459,7 +456,7 @@ namespace cds {
             on the start of each thread that uses HP GC. Before terminating the thread linked to HP GC it is necessary to call
             \ref cds_threading "cds::threading::Manager::detachThread()".
         */
-        class ThreadGC: cds::details::noncopyable
+        class ThreadGC
         {
             GarbageCollector&   m_HzpManager    ; ///< Hazard Pointer GC singleton
             details::HPRec *    m_pHzpRec       ; ///< Pointer to thread's HZP record
@@ -469,6 +466,9 @@ namespace cds {
                 : m_HzpManager( GarbageCollector::instance() ),
                 m_pHzpRec( nullptr )
             {}
+
+            ThreadGC( ThreadGC const& ) = delete;
+
             ~ThreadGC()
             {
                 fini();
index 7cb31de6a8e604e16daffb6c2ac61640913f77af..6605f92858d7b8552b835ea240a36842c55a793a 100644 (file)
@@ -8,7 +8,6 @@
 #include <cds/gc/details/retired_ptr.h>
 #include <cds/details/aligned_allocator.h>
 #include <cds/details/allocator.h>
-#include <cds/details/noncopyable.h>
 #include <cds/lock/spinlock.h>
 
 #if CDS_COMPILER == CDS_COMPILER_MSVC
@@ -487,7 +486,7 @@ namespace cds { namespace gc {
             };
 
             /// Uninitialized guard
-            class guard: public cds::details::noncopyable
+            class guard
             {
                 friend class ThreadGC;
             protected:
@@ -498,6 +497,8 @@ namespace cds { namespace gc {
                     : m_pGuard( nullptr )
                 {}
 
+                guard( guard const& ) = delete;
+
                 /// Object destructor, does nothing
                 ~guard()
                 {}
@@ -610,7 +611,7 @@ namespace cds { namespace gc {
             dtor returns the guards allocated back to the pool.
         */
         template <size_t Count>
-        class GuardArray: public cds::details::noncopyable
+        class GuardArray
         {
             details::guard      m_arr[Count]    ;    ///< array of guard
             ThreadGC&           m_gc    ;            ///< ThreadGC object of current thread
@@ -627,6 +628,9 @@ namespace cds { namespace gc {
             /// Allocates array of guards from \p gc which must be the ThreadGC object of current thread
             GuardArray( ThreadGC& gc )    ;    // inline below
 
+            GuardArray() = delete;
+            GuardArray( GuardArray const& ) = delete;
+
             /// Returns guards allocated back to pool
             ~GuardArray()    ;    // inline below
 
@@ -888,7 +892,7 @@ namespace cds { namespace gc {
             \li Free guard list: the list of thread-local free guards (linked by \p pNextFree field)
             Free guard list is a subset of thread guard list.
         */
-        class ThreadGC: public cds::details::noncopyable
+        class ThreadGC
         {
             GarbageCollector&   m_gc    ;   ///< reference to GC singleton
             details::guard_data *    m_pList ;   ///< Local list of guards owned by the thread
@@ -901,6 +905,8 @@ namespace cds { namespace gc {
                 , m_pFree( nullptr )
             {}
 
+            ThreadGC( ThreadGC const& ) = delete;
+
             /// Dtor calls fini()
             ~ThreadGC()
             {
index 37842a535a6972de97e66bd9ab79ea751d47f58b..0219eee8d53dc93b9503ab299ca2525503f22088 100644 (file)
@@ -16,8 +16,6 @@
 #include <cds/os/thread.h>
 #include <cds/algo/backoff_strategy.h>
 
-#include <cds/details/noncopyable.h>
-
 namespace cds {
     /// Synchronization primitives
     namespace lock {
index 1a36281a63ba021eb45865d75039c348cc21d5ae..4312558e03deb08e9cecb8efcfba4fabbc99c985 100644 (file)
     <ClInclude Include="..\..\..\cds\details\is_aligned.h" />\r
     <ClInclude Include="..\..\..\cds\details\make_const_type.h" />\r
     <ClInclude Include="..\..\..\cds\details\marked_ptr.h" />\r
-    <ClInclude Include="..\..\..\cds\details\noncopyable.h" />\r
     <ClInclude Include="..\..\..\cds\impl\queue_base.h" />\r
     <ClInclude Include="..\..\..\cds\details\trivial_assign.h" />\r
     <ClInclude Include="..\..\..\cds\details\type_padding.h" />\r
index f4b36afd2866f864c4a1b0c2832685882cec2037..1721d882c5086d6cb742e64a7ddde60f7627270b 100644 (file)
     <ClInclude Include="..\..\..\cds\details\marked_ptr.h">\r
       <Filter>Header Files\cds\details</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="..\..\..\cds\details\noncopyable.h">\r
-      <Filter>Header Files\cds\details</Filter>\r
-    </ClInclude>\r
     <ClInclude Include="..\..\..\cds\impl\queue_base.h">\r
       <Filter>Header Files\cds\details</Filter>\r
     </ClInclude>\r