]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Simplify cross-casting constness.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 1 Oct 2001 09:06:38 +0000 (09:06 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 1 Oct 2001 09:06:38 +0000 (09:06 +0000)
git-svn-id: https://svn.dealii.org/trunk@5124 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/block_vector.h

index 25bdd4bb6893f73399499628ceaca17b0f1786a9..643a8b2b26272e084239b8c9f80a85c9e7c1194d 100644 (file)
@@ -273,8 +273,7 @@ namespace BlockVectorIterators
                                        * converting a constant to a
                                        * non-constant iterator.
                                        */
-      template <bool constness2>
-      Iterator (const Iterator<number,constness2> &c);
+      Iterator (const InverseConstnessIterator &c);
 
     private:
                                       /**
@@ -1260,10 +1259,9 @@ namespace BlockVectorIterators
 
 
   template <typename number, bool constness>
-  template <bool constness2>
   inline
   Iterator<number,constness>::
-  Iterator (const Iterator<number,constness2> &c)
+  Iterator (const InverseConstnessIterator &c)
                  :
                  parent (c.parent),
                  global_index (c.global_index),
@@ -1272,8 +1270,12 @@ namespace BlockVectorIterators
                  next_break_forward (c.next_break_forward),
                  next_break_backward (c.next_break_backward)
   {
-    Assert (! ((constness==false) && (constness2==true)),
-           ExcCastingAwayConstness());
+                                    // if constness==false, then the
+                                    // constness of the iterator we
+                                    // got is true and we are trying
+                                    // to cast away the
+                                    // constness. disallow this
+    Assert (constness==false, ExcCastingAwayConstness());
   };
   
 

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.