On OS X, simple C++ program gives incorrect results (which are a result of c++03 vs c++11)

view story

http://stackoverflow.com – This simple program (when compiled on Linux) will CORRECTLY give two different answers based on whether it's compiled with -std=c++0x or not. Problem: I cannot reproduce the same thing on OS X (Mountain Lion, 10.8 SDK). What am I missing? #include <iostream> #include <sstream> class Thing : public std::ostringstream { public: Thing() : std::ostringstream() {} virtual ~Thing() { std::cerr << str(); } }; int main(int argc, const char * argv[]) { Thing() << "Hello" << std::endl; return 0; } To see what I mean, do the following (on Linux first (HowTos)