
9 Feb
2004
9 Feb
'04
10:52 p.m.
Hi, Excuse me if this is already somewhere in boost - I haven't managed to find it. Does anyone else think that an exception that you can write to like a stream would be useful? So that you could go throw streamy_exception() << "Couldn't open the file " << file_name; and then later catch (streamy_exception &s) { std::cerr << "Oops! : " << s; // or std::cerr << "Oops! : " << s.what(); } I have code that does the above - it really isn't very tricky. If there was interest I could tidy it up a bit. It'd probably be even better to use the format library to compose the error message - then translations would become much easier. Cheers, Geoff