Skip to content

Instantly share code, notes, and snippets.

@scottcarr
Created October 16, 2016 18:09
Embed
What would you like to do?
#include <iostream>
using namespace std;
class Foo {
public:
ostream* std_out;
Foo() : std_out(&cerr) {
std_out->setf(ios::showpoint | ios::left);
}
void print() {
*std_out << 4.5f << endl;
}
};
Foo x;
int main() {
x.print();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment