From 71da4620e93d3170cfe7fddd2c81075859a0927c Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Mon, 4 May 2015 09:20:39 +0200 Subject: [PATCH] Bugfix: Correctly set up object in move constructor --- include/deal.II/lac/vector.h | 5 +---- include/deal.II/lac/vector.templates.h | 7 +++++-- 2 files changed, 6 insertions(+), 6 deletions(-) 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 -- 2.39.5