Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.

Class invalid_syntax



// In header: <boost/program_options/errors.hpp>

class invalid_syntax : public boost::program_options::error_with_option_name {

  enum kind_t { long_not_allowed = = 30, long_adjacent_not_allowed, 
                short_adjacent_not_allowed, empty_adjacent_parameter, 
                missing_parameter, extra_parameter, unrecognized_line };
  // construct/copy/destruct
  invalid_syntax(kind_t, const std::string & = "", const std::string & = "", 
                 int = 0);

  // public member functions
  kind_t kind() const;
  virtual std::string tokens() const;

  // protected member functions
  std::string get_template(kind_t);


Class thrown when there's syntax error either for command line or config file options. See derived children for concrete classes.

invalid_syntax public construct/copy/destruct

  1. invalid_syntax(kind_t kind, const std::string & option_name = "", 
                   const std::string & original_token = "", int option_style = 0);
  2. ~invalid_syntax();

invalid_syntax public member functions

  1. kind_t kind() const;
  2. virtual std::string tokens() const;

    Convenience functions for backwards compatibility

invalid_syntax protected member functions

  1. std::string get_template(kind_t kind);

    Used to convert kind_t to a related error text