]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use initializer list instead of default initializer 6387/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Sun, 29 Apr 2018 20:49:20 +0000 (22:49 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Sun, 29 Apr 2018 20:49:20 +0000 (22:49 +0200)
include/deal.II/lac/read_write_vector.h

index e51958adaad9cec0ea5139c3cb6076c695ad62fd..8a9c754881c23bbf511787fbff37a259567ff54b 100644 (file)
@@ -610,7 +610,7 @@ namespace LinearAlgebra
     /**
      * Pointer to the array of local elements of this vector.
      */
-    std::unique_ptr<Number[], decltype (free) *> values = std::unique_ptr<Number[], decltype (free) *> (nullptr, free);
+    std::unique_ptr<Number[], decltype (free) *> values;
 
     /**
      * For parallel loops with TBB, this member variable stores the affinity
@@ -668,6 +668,9 @@ namespace LinearAlgebra
   template <typename Number>
   inline
   ReadWriteVector<Number>::ReadWriteVector ()
+    :
+    Subscriptor(),
+    values(nullptr, free)
   {
     // virtual functions called in constructors and destructors never use the
     // override in a derived class
@@ -681,7 +684,8 @@ namespace LinearAlgebra
   inline
   ReadWriteVector<Number>::ReadWriteVector (const ReadWriteVector<Number> &v)
     :
-    Subscriptor()
+    Subscriptor(),
+    values(nullptr, free)
   {
     this->operator=(v);
   }
@@ -691,6 +695,9 @@ namespace LinearAlgebra
   template <typename Number>
   inline
   ReadWriteVector<Number>::ReadWriteVector (const size_type size)
+    :
+    Subscriptor(),
+    values(nullptr, free)
   {
     // virtual functions called in constructors and destructors never use the
     // override in a derived class
@@ -703,6 +710,9 @@ namespace LinearAlgebra
   template <typename Number>
   inline
   ReadWriteVector<Number>::ReadWriteVector (const IndexSet &locally_stored_indices)
+    :
+    Subscriptor(),
+    values(nullptr, free)
   {
     // virtual functions called in constructors and destructors never use the
     // override in a derived class

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.