From: wolf Date: Wed, 16 Oct 2002 15:39:26 +0000 (+0000) Subject: Mini-doc and re-indentation. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8ec41992d5721a6aa2d27c45c276cd5bf9f90a0;p=dealii-svn.git Mini-doc and re-indentation. git-svn-id: https://svn.dealii.org/trunk@6660 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/base/reference.cc b/tests/base/reference.cc index a7fc66cf55..230bd8307a 100644 --- a/tests/base/reference.cc +++ b/tests/base/reference.cc @@ -12,6 +12,11 @@ //---------------------------- 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 #include #include @@ -21,25 +26,25 @@ 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 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