From d4e8419d9c25bc2a2a63e3ef3572533ac7651c48 Mon Sep 17 00:00:00 2001 From: schodet Date: Sun, 21 May 2006 00:23:53 +0000 Subject: Ajout d'une fonction générique pour la sortie d'un type quelquonque. --- i/marvin/src/log/logger.hh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/i/marvin/src/log/logger.hh b/i/marvin/src/log/logger.hh index 5bb8e42..cc47095 100644 --- a/i/marvin/src/log/logger.hh +++ b/i/marvin/src/log/logger.hh @@ -46,7 +46,7 @@ class Logger /// Output a integer. virtual Logger &operator<< (int i) = 0; /// Output a double. - virtual Logger &operator << (double d) = 0; + virtual Logger &operator<< (double d) = 0; /// TODO vector protected: @@ -54,4 +54,15 @@ class Logger Logger (void) { } }; +#include + +template +Logger &operator<< (Logger &l, const T &v) +{ + std::ostringstream ss; + ss << v; + l << ss.str (); + return l; +} + #endif // logger_hh -- cgit v1.2.3