Boost.Regex: bad_expression

###  | # Boost.Regex ## class bad_expression | ###

### Synopsis

#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

### Description

    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 24 Oct 2003

© Copyright John Maddock 1998- 2003

Use, modification and distribution are subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)