]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add some code to make the copiler happier with unitialized data members and copy...
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 8 Jun 1999 15:47:07 +0000 (15:47 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 8 Jun 1999 15:47:07 +0000 (15:47 +0000)
git-svn-id: https://svn.dealii.org/trunk@1385 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/exceptions.h
deal.II/base/include/base/smartpointer.h
deal.II/lac/include/lac/sparse_matrix.h

index a3dc9627872edea941cb8fd35d095d7c68823629..8b5fb94b6563e60776435f36b08d927d6473c3e7 100644 (file)
@@ -291,8 +291,8 @@ class ExceptionBase : public exception {
                                      *  condition and the name of the exception as
                                      *  a char pointer.
                                      */
-    void SetFields (const charf,
-                   const int l,
+    void SetFields (const char *f,
+                   const int   l,
                    const char *func,
                    const char *c,
                    const char *e);
index d89f7cf9c6e165d1637aa3f3f926a8f6b2468d48..c60294ec5deb00f8c66ccdf5f1e5a3c853f24283 100644 (file)
@@ -47,6 +47,14 @@ class SmartPointer
                                      */
     SmartPointer();
 
+                                    /*
+                                     * Copy constructor for
+                                     * #SmartPointer#. We copy the object
+                                     * subscribed to from #tt#, but subscribe
+                                     * ourselves to it again.
+                                     */
+    SmartPointer (const SmartPointer<T> &tt);
+
                                     /**
                                      * Constructor taking a normal pointer.
                                      * If possible, i.e. if the pointer
@@ -125,6 +133,16 @@ SmartPointer<T>::SmartPointer (T *t) :
 
 
 
+template <typename T>
+SmartPointer<T>::SmartPointer (const SmartPointer<T> &tt) :
+               t (tt.t)
+{
+  if (t)
+    t->subscribe();
+};
+
+
+
 template <typename T>
 SmartPointer<T>::~SmartPointer () {
   if (t)
index 9b7c83945b06736b7da434a0cf5f30c8ac6b4c1c..7304fae8afbbfa7c442a3394b0b0e8960b1ba534 100644 (file)
@@ -534,6 +534,15 @@ class SparseMatrixStruct : public Subscriptor
                                      * was called for this object.
                                      */
     bool compressed;
+
+                                    /**
+                                     * Copy operator. Declare but don't
+                                     * define it and make it private above
+                                     * that to avoid that anyone tries to
+                                     * use this operator.
+                                     */
+    SparseMatrixStruct & operator = (const SparseMatrixStruct &);
+
     
     template <typename number> friend class SparseMatrix;
 };

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.