freepooma-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Add const char* specialization to Inform::operator<<


From: Richard Guenther
Subject: [PATCH] Add const char* specialization to Inform::operator<<
Date: Fri, 14 Mar 2003 23:30:58 +0100 (CET)

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;
 }


reply via email to

[Prev in Thread] Current Thread [Next in Thread]