Boost logo

Boost :

From: Edward Diener (eddielee_at_[hidden])
Date: 2002-07-30 19:33:00


In the FAQ section to the regex documentation I read:

"The library should throw only three types of exception:
boost::bad_expression can be thrown by reg_expression when compiling a
regular expression; boost::bad_pattern can be thrown by the class
sub_match's conversion operators; finally std::bad_alloc can be thrown by
just about any of the functions in this library."

This appears to be incorrect as far as my own perusal of the code. The
std::runtime_exception can be thrown in these general cases:

1) When a message catalog can not be opened.
2) When a file can not be opened.

This translates into std::runtime_exception possibly being thrown in these
end user situations:

1) When a message catalog is specified and regex uses the cpp_regex_traits
and regex::imbue is called.
2) When a message catalog is specified and regex::assign is called.
3) When CRegex::GrepFiles or CRegex::FindFiles is called.

I think it is important that the end user of the regex library understand
very specifically when he should be ready to catch exceptions and I would
like to see this documented more clearly.


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