]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Document why the change was necessary 3864/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Mon, 30 Jan 2017 13:39:19 +0000 (14:39 +0100)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Mon, 30 Jan 2017 13:40:52 +0000 (14:40 +0100)
include/deal.II/base/symmetric_tensor.h

index 65b8626f0a1d482ceab5af2be8a563fbe69b206c..73cde3aa4f66bfdf09c93bac5222c3267fbac9fa 100644 (file)
@@ -2916,6 +2916,13 @@ operator * (const SymmetricTensor<rank,dim,Number> &t,
   // (as well as with switched arguments and double<->float).
   typedef typename ProductType<Number,OtherNumber>::type product_type;
   SymmetricTensor<rank,dim,product_type> tt(t);
+  // we used to shorten the following by 'tt *= product_type(factor);'
+  // which requires that a converting constructor
+  // 'product_type::product_type(const OtherNumber) is defined.
+  // however, a user-defined constructor is not allowed for aggregates,
+  // e.g. VectorizedArray. therefore, we work around this issue using a
+  // copy-assignment operator 'product_type::operator=(const OtherNumber)'
+  // which we assume to be defined.
   product_type new_factor;
   new_factor = factor;
   tt *= new_factor;

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.