]> https://gitweb.dealii.org/ - dealii.git/commitdiff
The C++ standard says that 'mutable' can't be applied to reference members, so change...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 26 Sep 2007 03:16:28 +0000 (03:16 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 26 Sep 2007 03:16:28 +0000 (03:16 +0000)
git-svn-id: https://svn.dealii.org/trunk@15240 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 398e79c3acf7610c24db1fd156fcad972979904b..e6e935b4411550220ece7c3bd3b4f330d465f7f0 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2004, 2005, 2006 by the deal.II authors
+//    Copyright (C) 2004, 2005, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -151,8 +151,13 @@ class ConditionalOStream
                                      * 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.
                                      */
-    mutable std::ostream  &output_stream;
+    mutable std::ostream  *output_stream;
 
                                     /**
                                      * Stores the actual condition
@@ -170,7 +175,7 @@ const ConditionalOStream &
 ConditionalOStream::operator<< (const T& t) const
 {
   if (active_flag == true)
-    output_stream << t;
+    *output_stream << t;
 
   return *this;
 }
@@ -181,7 +186,7 @@ const ConditionalOStream &
 ConditionalOStream::operator<< (std::ostream& (*p) (std::ostream&)) const
 {
   if (active_flag == true)
-    output_stream << p;
+    *output_stream << p;
 
   return *this;
 }
index 3168ecb7daf4aadec7e8f21f60c919f2225ac240..82410cc0c04469474c21d5d0d2a59574dbee86ea 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2004, 2005, 2006 by the deal.II authors
+//    Copyright (C) 2004, 2005, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -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.