From 92f8e307ee66bbd4262dee5fc7387954ba2e5d03 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Tue, 4 Aug 2009 19:27:57 +0000 Subject: Explicit Msg::op<< overrides for integral types, fixes a store compile problem. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@800931 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/include/qpid/Msg.h | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'cpp/include') diff --git a/cpp/include/qpid/Msg.h b/cpp/include/qpid/Msg.h index 5149a94d7f..6e08a89571 100644 --- a/cpp/include/qpid/Msg.h +++ b/cpp/include/qpid/Msg.h @@ -43,14 +43,29 @@ struct Msg { Msg(const Msg& m) : os(m.str()) {} std::string str() const { return os.str(); } operator std::string() const { return str(); } + + Msg& operator<<(long n) { os << n; return *this; } + Msg& operator<<(unsigned long n) { os << n; return *this; } + Msg& operator<<(bool n) { os << n; return *this; } + Msg& operator<<(short n) { os << n; return *this; } + Msg& operator<<(unsigned short n) { os << n; return *this; } + Msg& operator<<(int n) { os << n; return *this; } + Msg& operator<<(unsigned int n) { os << n; return *this; } +#ifdef _GLIBCXX_USE_LONG_LONG + Msg& operator<<(long long n) { os << n; return *this; } + Msg& operator<<(unsigned long long n) { os << n; return *this; } +#endif + Msg& operator<<(double n) { os << n; return *this; } + Msg& operator<<(float n) { os << n; return *this; } + Msg& operator<<(long double n) { os << n; return *this; } + + template Msg& operator<<(const T& t) { os < const Msg& operator<<(const Msg& m, const T& t) { - const_cast(m.os)<