This patch ensures we adhere to the normal ostream usage rules, and
restore the flags after modifying them.
{
using namespace std;
+ ios::fmtflags flags(out.flags());
+
switch (fmt.base) {
case Format::hex:
out.setf(std::ios::hex, std::ios::basefield);
out.setf(std::ios::uppercase);
out << data;
+
+ out.flags(flags);
}
template <typename T>
{
using namespace std;
+ ios::fmtflags flags(out.flags());
+
switch (fmt.float_format) {
case Format::scientific:
if (fmt.precision != -1) {
}
out << data;
+
+ out.flags(flags);
}
template <typename T>
void
System::printSystems()
{
+ ios::fmtflags flags(cerr.flags());
+
vector<System *>::iterator i = systemList.begin();
vector<System *>::iterator end = systemList.end();
for (; i != end; ++i) {
System *sys = *i;
cerr << "System " << sys->name() << ": " << hex << sys << endl;
}
+
+ cerr.flags(flags);
}
void