
3 Oct
2007
3 Oct
'07
2:53 p.m.
typedef tags<tag_file_name,tag_open_mode,tag_errno> file_err; throw my_error() << file_err(name,mode,errno);
Looks good. I wonder why my_error() is required. I wonder if a globaly static object, such as "boost::exception()" might be even cleaner and more lightweight. This would allow us to rewrite the throw statement like the following: try { throw boost::exception() << file_err(name,mode,errno); } catch(boost::exception& e) { std::cerr << e; }