]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Avoid compiler error.
authorkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 16 Aug 2011 12:13:33 +0000 (12:13 +0000)
committerkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 16 Aug 2011 12:13:33 +0000 (12:13 +0000)
git-svn-id: https://svn.dealii.org/trunk@24088 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/base/tensor_base.h

index ed309aeef7db6106236cec76e6dbf24c38eddcfe..2aa96ab57bf5e380232ec3fb02bcc5e39f854acb 100644 (file)
@@ -887,8 +887,13 @@ inline
 Tensor<1,dim,Number>::Tensor (const bool initialize)
 {
   if (initialize)
-    for (unsigned int i=0; i!=dim; ++i)
-      values[i] = 0;
+                               // need to create an object Number(0) to
+                               // initialize to zero to avoid confusion with
+                               // Tensor::operator=(scalar) when using
+                               // something like
+                               // Tensor<1,dim,Tensor<1,dim,Number> >.
+    for (unsigned int i=0; i<dim; ++i)
+      values[i] = Number(0);
 }
 
 

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.