|
Boost.Regexclass bad_expression |
|
#include <boost/pattern_except.hpp>
The class bad_expression
defines the type of objects thrown as
exceptions to report errors during the conversion from a string representing a
regular expression to a finite state machine.
namespace boost{ class bad_pattern : public std::runtime_error { public: explicit bad_pattern(const std::string& s) : std::runtime_error(s){}; }; class bad_expression : public bad_pattern { public: bad_expression(const std::string& s) : bad_pattern(s) {} }; } // namespace boost
bad_expression(const string& what_arg);
Effects: Constructs an object of class bad_expression
.
Postcondition: strcmp(what(), what_arg.c_str()) == 0
.
Footnotes: the class bad_pattern forms the base class for all pattern-matching exceptions, of which bad_expression is one. The choice of std::runtime_error as the base class for bad_pattern is moot; depending upon how the library is used exceptions may be either logic errors (programmer supplied expressions) or run time errors (user supplied expressions).
Revised 17 May 2003
© Copyright John Maddock 1998- 2003
Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. Dr John Maddock makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.