]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Undo the last patch: we don't need anything to be mutable here at all since we don...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 26 Sep 2007 15:12:29 +0000 (15:12 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 26 Sep 2007 15:12:29 +0000 (15:12 +0000)
git-svn-id: https://svn.dealii.org/trunk@15247 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/conditional_ostream.h
deal.II/base/source/conditional_ostream.cc

index e6e935b4411550220ece7c3bd3b4f330d465f7f0..0e1ff0d50519b3158e0b92932ea77a0d13a8a962 100644 (file)
@@ -141,23 +141,10 @@ class ConditionalOStream
 
   private:
                                     /**
-                                     * Pointer to <tt>cout</tt>. This
-                                     * class could easily be extended
-                                     * to treat streams different
-                                     * to the standard output.
-                                     *
-                                     * This variable must be @p mutable so
-                                     * that we can write to it in above @p
-                                     * const @p operator<< functions. For the
-                                     * reason why they, in turn, need to be
-                                     * @p const, see there.
-                                     *
-                                     * Now, we would like to make the
-                                     * variable a reference, but then the C++
-                                     * standard says that 'mutable' can't be
-                                     * applied to reference members.
+                                     * Reference to the stream we
+                                     * want to write to.
                                      */
-    mutable std::ostream  *output_stream;
+    std::ostream  &output_stream;
 
                                     /**
                                      * Stores the actual condition
@@ -175,7 +162,7 @@ const ConditionalOStream &
 ConditionalOStream::operator<< (const T& t) const
 {
   if (active_flag == true)
-    *output_stream << t;
+    output_stream << t;
 
   return *this;
 }
@@ -186,7 +173,7 @@ const ConditionalOStream &
 ConditionalOStream::operator<< (std::ostream& (*p) (std::ostream&)) const
 {
   if (active_flag == true)
-    *output_stream << p;
+    output_stream << p;
 
   return *this;
 }
index 82410cc0c04469474c21d5d0d2a59574dbee86ea..e5862f7f9b6b90bc7b01ba99250ec7aff2a54e0d 100644 (file)
@@ -18,7 +18,7 @@ DEAL_II_NAMESPACE_OPEN
 ConditionalOStream::ConditionalOStream(std::ostream &stream,
                                        const bool    active)
                 :
-               output_stream (&stream),
+               output_stream (stream),
                active_flag(active)
 {}
 

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.