]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Bugfix: Correctly set up object in move constructor
authorMatthias Maier <tamiko@43-1.org>
Mon, 4 May 2015 07:20:39 +0000 (09:20 +0200)
committerMatthias Maier <tamiko@43-1.org>
Mon, 4 May 2015 11:46:24 +0000 (13:46 +0200)
include/deal.II/lac/vector.h
include/deal.II/lac/vector.templates.h

index 318486ea5d7286a392cee375835bdda5f01d555a..df952f25fdabaa75e198a3c5b5a9dddb7cb915c2 100644 (file)
@@ -348,8 +348,7 @@ public:
 #ifdef DEAL_II_WITH_CXX11
   /**
    * Move the given vector. This operator replaces the present vector with
-   * @p v by efficiently swapping the internal data structures. @p v is
-   * left empty.
+   * @p v by efficiently swapping the internal data structures.
    *
    * @note This operator is only available if deal.II is configured with
    * C++11 support.
@@ -1115,8 +1114,6 @@ Vector<Number> &
 Vector<Number>::operator= (Vector<Number> &&v)
 {
   swap(v);
-  // be nice and reset v to zero
-  v.reinit(0, false);
 
   return *this;
 }
index a4f7c4ac3449049f3deb1e91f294ae408bb88d41..bd05a4a061ee93c4b42b059d700e77e5b1c4feca 100644 (file)
@@ -578,10 +578,13 @@ Vector<Number>::Vector (const Vector<Number> &v)
 #ifdef DEAL_II_WITH_CXX11
 template <typename Number>
 Vector<Number>::Vector (Vector<Number> &&v)
+  :
+  Subscriptor(),
+  vec_size(0),
+  max_vec_size(0),
+  val(0)
 {
   swap(v);
-  // be nice and reset v to zero
-  v.reinit(0, false);
 }
 #endif
 

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.