]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make VectorBase::operator= private and undefined. 3966/head
authorDavid Wells <wellsd2@rpi.edu>
Sat, 11 Feb 2017 22:35:14 +0000 (17:35 -0500)
committerDavid Wells <wellsd2@rpi.edu>
Sat, 11 Feb 2017 23:15:41 +0000 (18:15 -0500)
This operator was formerly implicitly defined, which provides, almost surely,
the wrong behavior since the underlying Vec will then be destroyed twice.

Since both inheriting classes (Vector and MPI::Vector) define their own
operator= overloads this operator is also not necessary.

doc/news/changes/incompatibilities/20170211DavidWells [new file with mode: 0644]
include/deal.II/lac/petsc_vector_base.h

diff --git a/doc/news/changes/incompatibilities/20170211DavidWells b/doc/news/changes/incompatibilities/20170211DavidWells
new file mode 100644 (file)
index 0000000..cfb16f0
--- /dev/null
@@ -0,0 +1,10 @@
+Changed: PETScWrappers::VectorBase::operator= is now both private and
+undefined. This operator was formerly implicitly defined (i.e., it did a
+byte-for-byte copy of VectorBase's members), which provided, almost certainly,
+the wrong behavior since the underlying <code>Vec</code> (the managed PETSc
+object) would then be destroyed twice. Since both inheriting classes
+(PETScWrappers::Vector and PETScWrappers::MPI::Vector) define their own
+operator= overloads this operator is also not necessary.
+
+<br>
+(David Wells, 2017/02/11)
index 5be9d803632578b75bbe83dc1560128f681576c7..cf7dac42b421726e77ca351c73b2d395c77d2070 100644 (file)
@@ -801,7 +801,13 @@ namespace PETScWrappers
                                const PetscScalar  *values,
                                const bool         add_values);
 
-
+  private:
+    /**
+     * Assignment operator. This is currently not implemented, so it is
+     * deliberately left as private (and undefined) to prevent accidental
+     * usage.
+     */
+    VectorBase &operator=(const VectorBase &);
   };
 
 

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.