[PATCH] Add const char* specialization to Inform::operator<<
Richard Guenther
rguenth at tat.physik.uni-tuebingen.de
Fri Mar 14 22:30:58 UTC 2003
Hi!
The following patch removes lots of Inform::operator<<(.., char[N])
instances from binaries by adding a specialization for const char*.
Ok?
Richard.
diff -Nru a/r2/src/Utilities/Inform.h b/r2/src/Utilities/Inform.h
--- a/r2/src/Utilities/Inform.h Fri Mar 14 23:28:50 2003
+++ b/r2/src/Utilities/Inform.h Fri Mar 14 23:28:50 2003
@@ -483,12 +483,22 @@
//-----------------------------------------------------------------------------
+// specialized function for sending C strings to Inform object
+//-----------------------------------------------------------------------------
+
+inline Inform &operator<<(Inform &o, const char *s)
+{
+ o.stream() << s;
+ return o;
+}
+
+//-----------------------------------------------------------------------------
// specialized function for sending strings to Inform object
//-----------------------------------------------------------------------------
inline Inform &operator<<(Inform &o, const std::string &s)
{
- o << s.c_str();
+ o.stream() << s.c_str();
return o;
}
More information about the pooma-dev
mailing list