
Emil Dotchevski wrote:
I'm not keen on the use of operator<< to add the data to the exceptions.
I do share your concern, but consider that whatever we use for boost exception should support easy composition, because it needs to work when used in a throw expression directly:
throw my_error() << error_info<tag_errno>(errno) << error_info<tag_name>(name);
Instead of << we could use .add:
throw my_error(). add(error_info<tag_errno>(errno)). add(error_info<tag_name>(name));
This isn't bad, but in my opinion the << syntax is better despite my strong dislike for operator overloading.
Maybe a more or less obvious choice will do throw my_error() = error_info<tag>(whatever), error_info<another_tag>(something_else) // ... Regards, Tobias Schwinger - Review Manager -