]> https://gitweb.dealii.org/ - dealii.git/commitdiff
SmartPointer: use nullptr instead of 0 5284/head
authorTimo Heister <timo.heister@gmail.com>
Fri, 20 Oct 2017 20:26:16 +0000 (16:26 -0400)
committerTimo Heister <timo.heister@gmail.com>
Fri, 20 Oct 2017 20:26:16 +0000 (16:26 -0400)
include/deal.II/base/smartpointer.h

index 5f42149320699531d78b51ce84436691459b08a8..2f9ef1720b064e0db60830317430b6fc14d37c43 100644 (file)
@@ -236,7 +236,7 @@ SmartPointer<T,P>::SmartPointer (const SmartPointer<T,Q> &tt)
   :
   t (tt.t), id(tt.id)
 {
-  if (t != 0)
+  if (t != nullptr)
     t->subscribe(id);
 }
 
@@ -269,11 +269,11 @@ inline
 void
 SmartPointer<T,P>::clear ()
 {
-  if (t != 0)
+  if (t != nullptr)
     {
       t->unsubscribe(id);
       delete t;
-      t = 0;
+      t = nullptr;
     }
 }
 
@@ -310,10 +310,10 @@ SmartPointer<T,P>::operator = (const SmartPointer<T,Q> &tt)
   if (&tt == this)
     return *this;
 
-  if (t != 0)
+  if (t != nullptr)
     t->unsubscribe(id);
   t = static_cast<T *>(tt);
-  if (tt != 0)
+  if (tt != nullptr)
     tt->subscribe(id);
   return *this;
 }
@@ -390,12 +390,12 @@ template <typename T, typename P>
 inline
 void SmartPointer<T,P>::swap (T *&tt)
 {
-  if (t != 0)
+  if (t != nullptr)
     t->unsubscribe (id);
 
   std::swap (t, tt);
 
-  if (t != 0)
+  if (t != nullptr)
     t->subscribe (id);
 }
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.