* Zapped header dependency from <strstream>.
authorRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Fri, 11 May 2001 14:16:11 +0000 (14:16 +0000)
committerRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Fri, 11 May 2001 14:16:11 +0000 (14:16 +0000)
ginac/numeric.h
ginac/utils.h

index 2d856aaabde5abd2a809a7cebe038c4a88f5d4f9..4f2ba1a1e3b4fa9c7c147f8f5082e27513e6357f 100644 (file)
@@ -23,7 +23,6 @@
 #ifndef __GINAC_NUMERIC_H__
 #define __GINAC_NUMERIC_H__
 
-#include <strstream>
 #include "basic.h"
 #include "ex.h"
 
index 79719feb9e2131ae166f05ce810f38253b657c2d..6edea866c16f22c2e0d533f0a42f2513b88d31df 100644 (file)
 #ifndef __GINAC_UTILS_H__
 #define __GINAC_UTILS_H__
 
-#include <strstream>
+#include "config.h"
+
 #include <string>
 #include <stdexcept>
-#include "config.h"
+#if defined(HAVE_SSTREAM)
+#include <sstream>
+#elif defined(HAVE_STRSTREAM)
+#include <strstream>
+#else
+#error Need either sstream or strstream
+#endif
 #include "assertion.h"
 
 namespace GiNaC {
@@ -36,9 +43,15 @@ namespace GiNaC {
 template<class T>
 std::string ToString(const T & t)
 {
+#if defined(HAVE_SSTREAM)
+       std::ostringstream buf;
+       buf << t << std::ends;
+       return buf.str();
+#else
        char buf[256];
        std::ostrstream(buf,sizeof(buf)) << t << std::ends;
        return buf;
+#endif
 }
 
 /** Exception class thrown by classes which provide their own series expansion