]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Don't use stringstream and <sstream>, rather use old-style strstream
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 18 Sep 2001 07:40:52 +0000 (07:40 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 18 Sep 2001 07:40:52 +0000 (07:40 +0000)
and <strstream>, because the former only existed from gcc2.95.3 on.

git-svn-id: https://svn.dealii.org/trunk@5021 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/source/table_handler.cc

index 03f7d8086c6469e1f906677c86c8afca140da2b0..bb0cbef3f7ce64f9d8cb37f74d16e5c2ec08babc 100644 (file)
 
 #include <base/table_handler.h>
 
-#include <sstream>
+#include <strstream>
 #include <iostream>
 #include <iomanip>
 
+//TODO:[WB] (compiler) use i/ostringstream instead of i/ostrstream if they become available
+
 
 TableEntryBase::TableEntryBase ()
 {}
@@ -234,7 +236,7 @@ void TableHandler::write_text(std::ostream &out) const
                                         // write it into a dummy
                                         // stream, just to get its
                                         // size upon output
-       std::ostringstream dummy_out;
+       std::ostrstream dummy_out;
        dummy_out << std::setprecision(column.precision);
 
        if (col_iter->second.scientific)
@@ -247,7 +249,7 @@ void TableHandler::write_text(std::ostream &out) const
                                         // get size, note that we are
                                         // not interested in the
                                         // trailing \0
-       entry_widths[i][j] = dummy_out.str().length()-1;
+       entry_widths[i][j] = strlen(dummy_out.str());
       };
 
                                   // next compute the width each row

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.