Replace NULL with nullptr
[libcds.git] / cds / gc / ptb / ptb.h
index 075deafe3382e271c53bc7cba5e0f9ed37187f01..b1afc4ff916a29ce3ceca291cacde9d8b1a859ad 100644 (file)
@@ -526,6 +526,14 @@ namespace cds { namespace gc {
                     return p;
                 }
 
+                //@cond
+                std::nullptr_t operator=(std::nullptr_t)
+                {
+                    clear();
+                    return nullptr;
+                }
+                //@endcond
+
             public: // for ThreadGC.
                 /*
                     GCC cannot compile code for template versions of ThreasGC::allocGuard/freeGuard,
@@ -587,6 +595,13 @@ namespace cds { namespace gc {
             {
                 return base_class::operator =<T>( p );
             }
+
+            //@cond
+            std::nullptr_t operator=(std::nullptr_t)
+            {
+                return base_class::operator =(nullptr);
+            }
+            //@endcond
         };
 
         /// Array of guards
@@ -649,7 +664,7 @@ namespace cds { namespace gc {
                 m_arr[nIndex].set( p );
             }
 
-            /// Clears (sets to NULL) the guard \p nIndex
+            /// Clears (sets to \p nullptr) the guard \p nIndex
             void clear( size_t nIndex )
             {
                 assert( nIndex < capacity() );