I have a utility macro "STR" in some old C++ code that I used to create formatted strings for printing.
#define STR(__msg) ({ std::stringstream __ss; __ss << __msg; __ss.str(); })
cout << STR("Hello" << "World" << "!" << "\n");
I couldn't remember why this code works. I did some googling and didn't find anything useful so I figured I'd ask here. Any takers?