]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Work around a problem where we have stringstream but where the wrong return type...
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 9 Jan 2002 07:26:22 +0000 (07:26 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 9 Jan 2002 07:26:22 +0000 (07:26 +0000)
git-svn-id: https://svn.dealii.org/trunk@5362 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/step-5/step-5.cc

index 493a03c65f663ebe644c4f82e443604ac52a88a8..91ef76fd63092efc48a020ee29f2924a53b72818 100644 (file)
@@ -858,9 +858,18 @@ void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
   
                                   // We can get whatever we wrote to
                                   // the stream using the ``str()''
-                                  // function. Use that as filename
+                                  // function. If the new stringstream
+                                   // classes are used, then the result is
+                                   // a string which we have to convert to
+                                   // a char* using the ``c_str()''
+                                   // function, otherwise the result is a
+                                   // char* right away.  Use that as filename
                                   // for the output stream:
+#ifdef HAVE_STD_STRINGSTREAM
+  std::ofstream output (filename.str().c_str());
+#else
   std::ofstream output (filename.str());
+#endif
                                   // And then write the data to the
                                   // file.
   data_out.write_eps (output);

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.