Effects: Inserts the duration
d onto the stream
os
as if it were implemented as follows:
basic_ostringstream<charT, traits> s;
s.flags(os.flags());
s.imbue(os.getloc());
s.precision(os.precision());
s << d.count() << units-suffix;
return os << s.str();
where
units-suffix
depends on the type
Period::type as follows:
- If Period::type is atto,
units-suffix is "as".
- Otherwise, if Period::type is femto,
units-suffix is "fs".
- Otherwise, if Period::type is pico,
units-suffix is "ps".
- Otherwise, if Period::type is nano,
units-suffix is "ns".
- Otherwise, if Period::type is micro,
it is
implementation-defined
whether units-suffix is
"Ξs" ("\u00b5\u0073") or
"us".
- Otherwise, if Period::type is milli,
units-suffix is "ms".
- Otherwise, if Period::type is centi,
units-suffix is "cs".
- Otherwise, if Period::type is deci,
units-suffix is "ds".
- Otherwise, if Period::type is ratio<1>,
units-suffix is "s".
- Otherwise, if Period::type is deca,
units-suffix is "das".
- Otherwise, if Period::type is hecto,
units-suffix is "hs".
- Otherwise, if Period::type is kilo,
units-suffix is "ks".
- Otherwise, if Period::type is mega,
units-suffix is "Ms".
- Otherwise, if Period::type is giga,
units-suffix is "Gs".
- Otherwise, if Period::type is tera,
units-suffix is "Ts".
- Otherwise, if Period::type is peta,
units-suffix is "Ps".
- Otherwise, if Period::type is exa,
units-suffix is "Es".
- Otherwise, if Period::type is ratio<60>,
units-suffix is "min".
- Otherwise, if Period::type is ratio<3600>,
units-suffix is "h".
- Otherwise, if Period::type is ratio<86400>,
units-suffix is "d".
- Otherwise, if Period::type::den == 1,
units-suffix is "[num]s".
- Otherwise, units-suffix is
"[num/den]s".
In the list above,
the use of
num and
den
refer to the static data members of
Period::type,
which are converted to arrays of
charT using a decimal conversion with no leading zeroes
.