Once upon a time, I read an article (possibly) by Herb Sutter, in which a good / safe method was added that allows you to pass a stream to an exception as it is thrown. Perhaps it was in Dr Dobbs magazine.
i.e. eg:
throw MyException() << "And this is my error message";
Does anyone remember the article and have the link too?
EDIT
Actually the article was written by Gigi Saifan
source share