
now in 1.33 it is
class regex_error : public std::runtime_error { public: explicit regex_error(const std::string& s, regex_constants::error_type err, std::ptrdiff_t pos); explicit regex_error(boost::regex_constants::error_type err); boost::regex_constants::error_type code()const; std::ptrdiff_t position()const; };
typedef regex_error bad_pattern; // for backwards compatibility typedef regex_error bad_expression; // for backwards compatibility
so I was wondering if there's a way to make
throw boost::bad_expression("internal error");
compile on both versions of the library (this statement was reported not to compile with 1.33 by a user of one of my programs)
many thanks in advance
I must admit I hadn't anticipated that folks would be throwing objects of that type (just catching them), the only fix is to change the constructor to: explicit regex_error(const std::string& s, regex_constants::error_type err = 0, std::ptrdiff_t pos = 0); Otherwise to change your code to add the extra parameters. I'll add this to the list of things to fix. John.