From: guido Date: Tue, 1 Jun 1999 09:11:02 +0000 (+0000) Subject: New = operator X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5044be2c719720692c3a3824861ed1d0a1efdc2;p=dealii-svn.git New = operator git-svn-id: https://svn.dealii.org/trunk@1353 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/sparse_matrix.h b/deal.II/lac/include/lac/sparse_matrix.h index c6bcccb081..9b7c83945b 100644 --- a/deal.II/lac/include/lac/sparse_matrix.h +++ b/deal.II/lac/include/lac/sparse_matrix.h @@ -609,6 +609,11 @@ class SparseMatrix : public Subscriptor * structure. */ virtual ~SparseMatrix (); + /** + * Pseudo operator only copying empty objects. + */ + SparseMatrix& operator = (const SparseMatrix &); + /** @@ -1049,12 +1054,6 @@ class SparseMatrix : public Subscriptor // friends template friend class SparseMatrix; - /** - * Made #operator =# private to - * avoid improper use. - */ - SparseMatrix& operator = (const SparseMatrix &); - }; diff --git a/deal.II/lac/include/lac/sparse_matrix.templates.h b/deal.II/lac/include/lac/sparse_matrix.templates.h index 5218fd84b0..5818de14c4 100644 --- a/deal.II/lac/include/lac/sparse_matrix.templates.h +++ b/deal.II/lac/include/lac/sparse_matrix.templates.h @@ -37,7 +37,17 @@ SparseMatrix::SparseMatrix (const SparseMatrix &m) : Assert (m.max_len==0, ExcInvalidConstructorCall()); }; +template +SparseMatrix& +SparseMatrix::operator = (const SparseMatrix &m) +{ + Assert (m.cols==0, ExcInvalidConstructorCall()); + Assert (m.val==0, ExcInvalidConstructorCall()); + Assert (m.max_len==0, ExcInvalidConstructorCall()); + return *this; +}; + template SparseMatrix::SparseMatrix (const SparseMatrixStruct &c) :