]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Remove workarounds that were necessary for 2.95
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 9 Sep 2007 00:36:14 +0000 (00:36 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 9 Sep 2007 00:36:14 +0000 (00:36 +0000)
git-svn-id: https://svn.dealii.org/trunk@15177 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/sparse_matrix.h
deal.II/lac/include/lac/sparsity_pattern.h

index 297d84298c4929f8abbf6496a28664e0842ef585..a01df8fda3091d99bcd254023c36cc956954baab 100644 (file)
@@ -75,17 +75,6 @@ namespace internals
                                           */
         typedef const SparseMatrix<number> MatrixType;
 
-                                         /**
-                                          * Create a typedef for the non-const
-                                          * version of this accessor. This is
-                                          * only used in one place, but is
-                                          * needed to work around a problem in
-                                          * gcc 2.95 and 3.0.
-                                          */
-        typedef
-        internals::SparseMatrixIterators::Accessor<number,false>
-        NonConstAccessor;
-        
                                          /**
                                           * Constructor.
                                           */
@@ -104,7 +93,7 @@ namespace internals
                                           * non-const accessor to a const
                                           * accessor.
                                           */
-        Accessor (const NonConstAccessor &a);
+        Accessor (const internals::SparseMatrixIterators::Accessor<number,false> &a);
 
                                          /**
                                           * Value of this matrix entry.
@@ -119,12 +108,24 @@ namespace internals
                                           * reference.
                                           */
         MatrixType & get_matrix () const;
-        
+
       private:
                                          /**
                                           * Pointer to the matrix we use.
                                           */
         MatrixType *matrix;
+
+                                        /**
+                                         * Make the advance function of the
+                                         * base class available.
+                                         */
+       using SparsityPatternIterators::Accessor::advance;
+
+                                        /**
+                                         * Make iterator class a friend.
+                                         */
+       template <typename, bool>
+       friend class Iterator;
     };
     
 
@@ -287,6 +288,18 @@ namespace internals
                                           */
         MatrixType *matrix;
 
+                                        /**
+                                         * Make the advance function of the
+                                         * base class available.
+                                         */
+       using SparsityPatternIterators::Accessor::advance;
+
+                                        /**
+                                         * Make iterator class a friend.
+                                         */
+       template <typename, bool>
+       friend class Iterator;
+       
                                          /**
                                           * Make the inner reference class a
                                           * friend if the compiler has a bug
@@ -325,18 +338,6 @@ namespace internals
         typedef
         typename Accessor<number,Constness>::MatrixType
         MatrixType;
-        
-
-                                         /**
-                                          * Create a typedef for the non-const
-                                          * version of this iterator. This is
-                                          * only used in one place, but is
-                                          * needed to work around a problem in
-                                          * gcc 2.95 and 3.0.
-                                          */
-        typedef
-        internals::SparseMatrixIterators::Iterator<number,false>
-        NonConstIterator;
 
                                          /**
                                           * Constructor. Create an iterator
@@ -357,15 +358,8 @@ namespace internals
                                           * Conversion constructor to get from
                                           * a non-const iterator to a const
                                           * iterator.
-                                          *
-                                          * (Note: the fact that we fully
-                                          * specialize the namespace of the
-                                          * accessor class is to work around a
-                                          * bug in gcc 2.95 and 3.0. We really
-                                          * mean the present class, but with
-                                          * different template arguments.)
                                           */
-        Iterator (const NonConstIterator &i);
+        Iterator (const internals::SparseMatrixIterators::Iterator<number,false> &i);
         
                                          /**
                                           * Prefix increment.
@@ -2057,7 +2051,7 @@ namespace internals
     template <typename number>
     inline
     Accessor<number,true>::
-    Accessor (const NonConstAccessor &a)
+    Accessor (const internals::SparseMatrixIterators::Accessor<number,false> &a)
                     :
                     SparsityPatternIterators::Accessor (a),
                     matrix (&a.get_matrix())
@@ -2241,7 +2235,7 @@ namespace internals
     template <typename number, bool Constness>
     inline
     Iterator<number, Constness>::
-    Iterator (const NonConstIterator &i)
+    Iterator (const internals::SparseMatrixIterators::Iterator<number,false> &i)
                     :
                     accessor(*i)
     {}
index 50523baabcf6a80c34edebf722669a40b9c2e05a..363d7dac590de53fbe89cf6639fab0deffba8a47 100644 (file)
@@ -259,18 +259,6 @@ namespace internals
                                           */
        bool operator < (const Accessor &) const;
 
-                                         /**
-                                          * Move the accessor to the next
-                                          * nonzero entry in the matrix. This
-                                          * function should actually only be
-                                          * called from iterator classes, but
-                                          * due to various problems with
-                                          * friends and templates in gcc 2.95,
-                                          * we can't make it protected. Don't
-                                          * use it in your own programs.
-                                          */
-        void advance ();
-
                                         /** @addtogroup Exceptions
                                          * @{ */
        
@@ -296,6 +284,12 @@ namespace internals
                                           */
         unsigned int a_index;
 
+                                         /**
+                                          * Move the accessor to the next
+                                          * nonzero entry in the matrix.
+                                          */
+        void advance ();
+       
                                          /**
                                           * Grant access to iterator class.
                                           */

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.