]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
only use std::ends when necessary, i.e. for the old strstream classes.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 13 Mar 2002 10:06:36 +0000 (10:06 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 13 Mar 2002 10:06:36 +0000 (10:06 +0000)
git-svn-id: https://svn.dealii.org/trunk@5565 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/source/exceptions.cc
deal.II/base/source/log.cc
deal.II/base/source/parameter_handler.cc
deal.II/base/source/table_handler.cc
deal.II/deal.II/source/numerics/data_out.cc
deal.II/doc/news/2002/c-3-3.html
deal.II/examples/step-5/step-5.cc
deal.II/lac/source/solver_control.cc

index c7f34ce36c01e6f87fcb326325da5d92211d0233..fc4a4bb4b8d96936278241054c157eedaaaa4cbf 100644 (file)
@@ -113,8 +113,10 @@ const char * ExceptionBase::what () const throw ()
   PrintInfo (converter);
   
   converter << "--------------------------------------------------------"
-           << std::endl
-           << std::ends;
+           << std::endl;
+#ifndef HAVE_STD_STRINGSTREAM
+  converter << std::ends;
+#endif
 
   description = converter.str();
 
index 38f40be60468d96f469f7a5375c91a3c9c9e67a1..927eb9455055b92770afd0292df84e8e24947107 100644 (file)
@@ -170,7 +170,10 @@ LogStream::print_line_head()
   std::ostrstream statname;
 #endif
   
-  statname << "/proc/" << id << "/stat" << std::ends;
+  statname << "/proc/" << id << "/stat";
+#ifndef HAVE_STD_STRINGSTREAM
+  statname << std::ends;
+#endif
   static long size;
   static string dummy;
   ifstream stat(statname.str());
index 06d34561927cac23c02a5e30bf84582cda626a8a..0c5db04b5875f8338da827fe65e1e39d0850cbf7 100644 (file)
@@ -123,8 +123,10 @@ namespace Patterns
        
        description << "[Integer range "
                    << lower_bound << "..." << upper_bound
-                   << " (inclusive)]"
-                   << std::ends;
+                   << " (inclusive)]";
+#ifndef HAVE_STD_STRINGSTREAM
+       description << std::ends;
+#endif
        return description.str();
       }
     else
@@ -205,8 +207,10 @@ namespace Patterns
 
        description << "[Floating point range "
                    << lower_bound << "..." << upper_bound
-                   << " (inclusive)]"
-                   << std::ends;
+                   << " (inclusive)]";
+#ifndef HAVE_STD_STRINGSTREAM  
+       description << std::ends;
+#endif
        return description.str();
       }
     else
index c70e6d67628f43405146fedb764f396542e449d6..fe6451631bccebe5b8d543c309c837659a667818 100644 (file)
@@ -254,8 +254,10 @@ void TableHandler::write_text(std::ostream &out) const
        else
          dummy_out.setf (std::ios::fixed, std::ios::floatfield);
        column.entries[i]->write_text (dummy_out);
+#ifndef HAVE_STD_STRINGSTREAM
        dummy_out << std::ends;
-
+#endif
+       
                                         // get size, note that we are
                                         // not interested in the
                                         // trailing \0
index 4d943bfdacdce1c78de72471042f3b02cf834abd..b000032938046dd2c088a4856208fe1184613231 100644 (file)
@@ -213,7 +213,10 @@ add_data_vector (const VECTOR         &vec,
 #else
          std::ostrstream namebuf;
 #endif
-         namebuf << '_' << i << std::ends;
+         namebuf << '_' << i;
+#ifndef HAVE_STD_STRINGSTREAM
+         namebuf << std::ends;
+#endif
          names[i] = name + namebuf.str();
        };
     };
index 9c5eeb5b0d76776f6d66e69af364635461109e2c..534e64b95ba9954a6c0d767213dbec05842be923 100644 (file)
@@ -33,6 +33,17 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK
 <h3>General</h3>
 
 <ol>
+  <li> <p> 
+       Fixed: For gcc versions that used <code
+       class="class">ostrstream</code> instead of <code
+       class="class">ostringstream</code>, it was necessary to append
+       a final <code class="member">std::ends</code> when piping text
+       into the string stream. This was not previously
+       conditionalized, but done for old and new classes.
+       <br>
+       (WB 2002/03/13)
+       </p>
+
   <li> <p> 
        Changed: The configure machinery has been revamped
        significantly.
index a244c6f713cc8fd0e871ddd313ded77a2170dc67..e8c2388d2d5a408455bead4d3901debec6d97a12 100644 (file)
@@ -837,11 +837,16 @@ void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
   filename << "solution-"
           << cycle
           << ".eps";
-                                  // In order to append the final
-                                  // '\0', we have to put an ``ends''
-                                  // to the end of the string:
-  filename << std::ends;
   
+                                  // For the old string stream
+                                  // classes, we have to append the
+                                  // final '\0' that appears at the
+                                  // end of ``char *''
+                                  // variables. This is done by the
+                                  // following construct:
+#ifndef HAVE_STD_STRINGSTREAM
+  filename << std::ends;
+#endif
                                   // We can get whatever we wrote to
                                   // the stream using the ``str()''
                                   // function. If the new
index 4208132d753401f8efde93814ce7bca6b1780bfb..7d49e00e4ee1e53ce39915f2468d09672cc215a4 100644 (file)
@@ -59,7 +59,10 @@ SolverControl::NoConvergence::what () const throw ()
 #endif
 
   out << "Iterative method reported convergence failure in step "
-      << last_step << " with residual " << last_residual << std::ends;
+      << last_step << " with residual " << last_residual;
+#ifndef HAVE_STD_STRINGSTREAM
+  out << std::ends;
+#endif
 
   description = out.str();
   return description.c_str();

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.