Make Time printer ignore stream flags.
This commit is contained in:
@@ -701,7 +701,13 @@ inline Time Min (const Time &ta, const Time &tb)
|
||||
/**
|
||||
* \brief Time output streamer.
|
||||
*
|
||||
* Generates output such as "3.96ns"
|
||||
* Generates output such as "3.96ns". Times are printed with the
|
||||
* following format flags (independent of the stream flags):
|
||||
* - `showpos`
|
||||
* - `fixed`
|
||||
* - `left`
|
||||
* The stream `width` and `precision` are ignored; Time output always
|
||||
* includes ".0".
|
||||
* \relates ns3::Time
|
||||
*/
|
||||
std::ostream& operator<< (std::ostream& os, const Time & time);
|
||||
|
||||
@@ -424,6 +424,8 @@ operator<< (std::ostream& os, const Time & time)
|
||||
int64_t v = time.ToInteger (res);
|
||||
|
||||
std::ios_base::fmtflags ff = os.flags ();
|
||||
|
||||
os << std::setw (0) << std::left;
|
||||
{ // See bug 1737: gcc libstc++ 4.2 bug
|
||||
if (v == 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user