From a33f0a76c8c9ff9f75e2896d6417388b84d572af Mon Sep 17 00:00:00 2001 From: bangerth Date: Sun, 9 Sep 2007 00:36:14 +0000 Subject: [PATCH] Remove workarounds that were necessary for 2.95 git-svn-id: https://svn.dealii.org/trunk@15177 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/sparse_matrix.h | 64 ++++++++++------------ deal.II/lac/include/lac/sparsity_pattern.h | 18 ++---- 2 files changed, 35 insertions(+), 47 deletions(-) diff --git a/deal.II/lac/include/lac/sparse_matrix.h b/deal.II/lac/include/lac/sparse_matrix.h index 297d84298c..a01df8fda3 100644 --- a/deal.II/lac/include/lac/sparse_matrix.h +++ b/deal.II/lac/include/lac/sparse_matrix.h @@ -75,17 +75,6 @@ namespace internals */ typedef const SparseMatrix 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 - NonConstAccessor; - /** * Constructor. */ @@ -104,7 +93,7 @@ namespace internals * non-const accessor to a const * accessor. */ - Accessor (const NonConstAccessor &a); + Accessor (const internals::SparseMatrixIterators::Accessor &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 + 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 + 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::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 - 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 &i); /** * Prefix increment. @@ -2057,7 +2051,7 @@ namespace internals template inline Accessor:: - Accessor (const NonConstAccessor &a) + Accessor (const internals::SparseMatrixIterators::Accessor &a) : SparsityPatternIterators::Accessor (a), matrix (&a.get_matrix()) @@ -2241,7 +2235,7 @@ namespace internals template inline Iterator:: - Iterator (const NonConstIterator &i) + Iterator (const internals::SparseMatrixIterators::Iterator &i) : accessor(*i) {} diff --git a/deal.II/lac/include/lac/sparsity_pattern.h b/deal.II/lac/include/lac/sparsity_pattern.h index 50523baabc..363d7dac59 100644 --- a/deal.II/lac/include/lac/sparsity_pattern.h +++ b/deal.II/lac/include/lac/sparsity_pattern.h @@ -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. */ -- 2.39.5