]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Compare pointers for equality by the object pointed to.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 13 Jun 2011 17:52:28 +0000 (17:52 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 13 Jun 2011 17:52:28 +0000 (17:52 +0000)
git-svn-id: https://svn.dealii.org/trunk@23809 0785d39b-7218-0410-832d-ea1e28bc413d

tests/serialization/serialization.h

index 89b2682bb035ddc3b70d27ea9e4612486efa27c7..fd4ac60754b038c090bdccdfb9e9bf53d4c81446 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2010 by the deal.II authors
+//    Copyright (C) 2010, 2011 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
 #include <iomanip>
 
 
+// compare objects for equality and pointers for equality of the object
+// pointed to
+template <typename T>
+bool compare (T t1,
+             T t2)
+{
+  return t1 == t2;
+}
+
+template <typename T>
+bool compare (T *t1,
+             T *t2)
+{
+  return *t1 == *t2;
+}
+
+
 template <typename T>
 void verify (const T &t1,
             T       &t2)
@@ -45,7 +62,7 @@ void verify (const T &t1,
 
     ia >> t2;
 
-    Assert (t1 == t2, ExcInternalError());
+    Assert (compare (t1, t2), ExcInternalError());
   }
 }
 

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.