Fixed in r15052, note this patch introduces a different bug:  what if my fill character were '-' before the call to operator<<,  or if field width were 17.  boost io state savers to the rescue...<br><br><div class="gmail_quote">
On Wed, Sep 28, 2011 at 7:56 AM, Ruben Smits <span dir="ltr"><<a href="mailto:ruben.smits@mech.kuleuven.be">ruben.smits@mech.kuleuven.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br>
<br>
I noticed that all space created with setw in an ostream gets filled zeros<br>
after a ros::Time object has been printed in the ostream.<br>
<br>
A patch is availble in the following ticket:<br>
<a href="https://code.ros.org/trac/ros/ticket/3693" target="_blank">https://code.ros.org/trac/ros/ticket/3693</a><br>
<br>
It just resets the fill caracter to space after the time is printed:<br>
<br>
--- time.cpp.original   2011-09-28 16:48:45.000000000 +0200<br>
+++ time.cpp    2011-09-28 16:41:41.000000000 +0200<br>
@@ -311,13 +311,13 @@<br>
<br>
   std::ostream& operator<<(std::ostream& os, const Time &rhs)<br>
   {<br>
-    os << rhs.sec << "." << std::setw(9) << std::setfill('0') << rhs.nsec;<br>
+    os << rhs.sec << "." << std::setw(9) << std::setfill('0') <<<br>
rhs.nsec<<std::setfill(' ');<br>
     return os;<br>
   }<br>
<br>
   std::ostream& operator<<(std::ostream& os, const Duration& rhs)<br>
   {<br>
-    os << rhs.sec << "." << std::setw(9) << std::setfill('0') << rhs.nsec;<br>
+    os << rhs.sec << "." << std::setw(9) << std::setfill('0') <<<br>
rhs.nsec<<std::setfill(' ');<br>
     return os;<br>
   }<br>
<br>
<br>
-- Ruben<br>
_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org">ros-users@code.ros.org</a><br>
<a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
</blockquote></div><br>