]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Use a better way to see whether two vectors are the same.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 4 Nov 2007 00:08:09 +0000 (00:08 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 4 Nov 2007 00:08:09 +0000 (00:08 +0000)
git-svn-id: https://svn.dealii.org/trunk@15435 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 70c396ede122d01078a42c1149b33f3fc18b8802..3cea6f17f280fdce5c37147eff896fad13c3f78c 100644 (file)
@@ -14,6 +14,7 @@
 #define __deal2__vector_templates_h
 
 
+#include <base/template_constraints.h>
 #include <lac/vector.h>
 #include <lac/block_vector.h>
 
@@ -201,7 +202,7 @@ Number Vector<Number>::operator * (const Vector<Number2>& v) const
 {
   Assert (vec_size!=0, ExcEmptyObject());
   
-  if (this == reinterpret_cast<const Vector<Number>*>(&v))
+  if (PointerComparison::equal (this, &v))
     return norm_sqr();
   
   Assert (vec_size == v.size(), ExcDimensionMismatch(vec_size, v.size()));

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.