]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Mini-doc and re-indentation.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 16 Oct 2002 15:39:26 +0000 (15:39 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 16 Oct 2002 15:39:26 +0000 (15:39 +0000)
git-svn-id: https://svn.dealii.org/trunk@6660 0785d39b-7218-0410-832d-ea1e28bc413d

tests/base/reference.cc

index a7fc66cf554b2f0220e1e1e7497c881252058839..230bd8307abcc298857366ac2e84399c513a99f3 100644 (file)
 //----------------------------  reference.cc  ---------------------------
 
 
+// check that SmartPointers preserve constness etc of the objects they
+// point to, through assignment of SmartPointers to each other and
+// other tests.
+
+
 #include <fstream>
 #include <base/subscriptor.h>
 #include <base/smartpointer.h>
 
 class Test : public Subscriptor
 {
-  const char* name;
-public:
-  Test(const char* n) :
-                 name(n)
+    const char* name;
+  public:
+    Test(const char* n) :
+                    name(n)
       {
        deallog << "Construct " << name << std::endl;
       }
-  ~Test()
+    ~Test()
       {
        deallog << "Destruct " << name << std::endl;
       }          
-  void f()
-  {
-    deallog << "mutable" << std::endl;
-  }
-  void f() const
-  {
-    deallog << "const" << std::endl;
-  }
+    void f()
+      {
+        deallog << "mutable" << std::endl;
+      }
+    void f() const
+      {
+        deallog << "const" << std::endl;
+      }
 };
 
 
@@ -58,7 +63,7 @@ int main()
   SmartPointer<const Test> u=&b;
 
 
-deallog << "a ";
+  deallog << "a ";
   a.f();            // should print "mutable", since #a# is not const
   deallog << "b ";
   b.f();            // should print "const", since #b# is const

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.