Boost logo

Boost :

From: Tom Brinkman (reportbase_at_[hidden])
Date: 2007-09-30 13:46:55


> 3) Support for linking multiple error tags in a single expression
> might be useful and help in standarizing errors throughout an application.
>
> throw boost:::exception() <<
> boost::error_info<tag_errorno,tag_filename,tag_size,tag_width>(
> (1,"output.txt",100,200);

>> Could you clarify what you mean?

Well, I could do something like this:

typedef boost::error_info<tag_errorno,
     tag_filename,tag_size,tag_width> error_t;

throw error_t(1,"output.txt",100,200);

If this error was common throughtout an application, this
typedef would make the code more readable.

Many boost components support variable number of
template arguments. It would be trivial to implement I think.

You could even default the template arguments, to
shorten the expression even further, such as:

typedef boost::standard_error<> standard_error_t;
throw standard_error_t();

You could do this instead of the "ugly" macros that
you have for the "_LINE_", "_FILE_" and "_FUNCTION_".

>> Usage of the stream operator (<<) for data insertion.

I like using (<<) for data insertion and see no reason
to remove it.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk