From: Matthias Maier Date: Mon, 4 May 2015 07:20:39 +0000 (+0200) Subject: Bugfix: Correctly set up object in move constructor X-Git-Tag: v8.3.0-rc1~202^2~10 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71da4620e93d3170cfe7fddd2c81075859a0927c;p=dealii.git Bugfix: Correctly set up object in move constructor --- diff --git a/include/deal.II/lac/vector.h b/include/deal.II/lac/vector.h index 318486ea5d..df952f25fd 100644 --- a/include/deal.II/lac/vector.h +++ b/include/deal.II/lac/vector.h @@ -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 & Vector::operator= (Vector &&v) { swap(v); - // be nice and reset v to zero - v.reinit(0, false); return *this; } diff --git a/include/deal.II/lac/vector.templates.h b/include/deal.II/lac/vector.templates.h index a4f7c4ac34..bd05a4a061 100644 --- a/include/deal.II/lac/vector.templates.h +++ b/include/deal.II/lac/vector.templates.h @@ -578,10 +578,13 @@ Vector::Vector (const Vector &v) #ifdef DEAL_II_WITH_CXX11 template Vector::Vector (Vector &&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