]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use a clearer initialization syntax. 4622/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Mon, 17 Jul 2017 23:11:20 +0000 (17:11 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Mon, 17 Jul 2017 23:11:20 +0000 (17:11 -0600)
Specifically, we used the syntax
  Type object = initializer;
in contexts where the initializer is of a different type and the
compiler automatically converted this into
  Type object(initializer);
where the constructor called was just a regular constructor
that did something with the initializer, but specifically did not
copy the object. This is confusing. Use the latter syntax instead.

include/deal.II/lac/relaxation_block.templates.h

index c0b7d03ab6f2432dd6cf36fdc25daf8a843e863c..63deb43a735d660a7d6a54045cb2897ffdb06990 100644 (file)
@@ -279,7 +279,7 @@ void RelaxationBlockJacobi<MatrixType, InverseNumberType, VectorType>::step
  const VectorType &src) const
 {
   GrowingVectorMemory<VectorType> mem;
-  typename VectorMemory<VectorType>::Pointer aux = mem;
+  typename VectorMemory<VectorType>::Pointer aux(mem);
   aux->reinit(dst, false);
   *aux = dst;
   this->do_step(dst, *aux, src, false);
@@ -292,7 +292,7 @@ void RelaxationBlockJacobi<MatrixType, InverseNumberType, VectorType>::Tstep
  const VectorType &src) const
 {
   GrowingVectorMemory<VectorType> mem;
-  typename VectorMemory<VectorType>::Pointer aux = mem;
+  typename VectorMemory<VectorType>::Pointer aux(mem);
   aux->reinit(dst, false);
   *aux = dst;
   this->do_step(dst, *aux, src, true);
@@ -305,7 +305,7 @@ void RelaxationBlockJacobi<MatrixType, InverseNumberType, VectorType>::vmult
  const VectorType &src) const
 {
   GrowingVectorMemory<VectorType> mem;
-  typename VectorMemory<VectorType>::Pointer aux = mem;
+  typename VectorMemory<VectorType>::Pointer aux(mem);
   dst = 0;
   aux->reinit(dst);
   this->do_step(dst, *aux, src, false);
@@ -318,7 +318,7 @@ void RelaxationBlockJacobi<MatrixType, InverseNumberType, VectorType>::Tvmult
  const VectorType &src) const
 {
   GrowingVectorMemory<VectorType> mem;
-  typename VectorMemory<VectorType>::Pointer aux = mem;
+  typename VectorMemory<VectorType>::Pointer aux(mem);
   dst = 0;
   aux->reinit(dst);
   this->do_step(dst, *aux, src, true);

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.