Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize noexcept specifiers #129

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions include/boost/program_options/errors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ namespace boost { namespace program_options {
/** gcc says that throw specification on dtor is loosened
* without this line
* */
BOOST_DEFAULTED_FUNCTION(~error_with_option_name() throw(), {})
BOOST_DEFAULTED_FUNCTION(~error_with_option_name(), {})


//void dump() const
Expand Down Expand Up @@ -183,7 +183,7 @@ namespace boost { namespace program_options {

/** Creates the error_message on the fly
* Currently a thin wrapper for substitute_placeholders() */
virtual const char* what() const throw();
virtual const char* what() const BOOST_NOEXCEPT_OR_NOTHROW;

protected:
/** Used to hold the error text returned by what() */
Expand All @@ -209,7 +209,7 @@ namespace boost { namespace program_options {
multiple_values()
: error_with_option_name("option '%canonical_option%' only takes a single argument"){}

BOOST_DEFAULTED_FUNCTION(~multiple_values() throw(), {})
BOOST_DEFAULTED_FUNCTION(~multiple_values(), {})
};

/** Class thrown when there are several occurrences of an
Expand All @@ -220,7 +220,7 @@ namespace boost { namespace program_options {
multiple_occurrences()
: error_with_option_name("option '%canonical_option%' cannot be specified more than once"){}

BOOST_DEFAULTED_FUNCTION(~multiple_occurrences() throw(), {})
BOOST_DEFAULTED_FUNCTION(~multiple_occurrences(), {})

};

Expand All @@ -233,7 +233,7 @@ namespace boost { namespace program_options {
{
}

BOOST_DEFAULTED_FUNCTION(~required_option() throw(), {})
BOOST_DEFAULTED_FUNCTION(~required_option(), {})
};

/** Base class of unparsable options,
Expand All @@ -258,7 +258,7 @@ namespace boost { namespace program_options {
/** Does NOT set option name, because no option name makes sense */
virtual void set_option_name(const std::string&) {}

BOOST_DEFAULTED_FUNCTION(~error_with_no_option_name() throw(), {})
BOOST_DEFAULTED_FUNCTION(~error_with_no_option_name(), {})
};


Expand All @@ -270,7 +270,7 @@ namespace boost { namespace program_options {
{
}

BOOST_DEFAULTED_FUNCTION(~unknown_option() throw(), {})
BOOST_DEFAULTED_FUNCTION(~unknown_option(), {})
};


Expand All @@ -283,9 +283,9 @@ namespace boost { namespace program_options {
m_alternatives(xalternatives)
{}

BOOST_DEFAULTED_FUNCTION(~ambiguous_option() throw(), {})
BOOST_DEFAULTED_FUNCTION(~ambiguous_option(), {})

const std::vector<std::string>& alternatives() const throw() {return m_alternatives;}
const std::vector<std::string>& alternatives() const BOOST_NOEXCEPT_OR_NOTHROW {return m_alternatives;}

protected:
/** Makes all substitutions using the template */
Expand Down Expand Up @@ -320,7 +320,7 @@ namespace boost { namespace program_options {
{
}

BOOST_DEFAULTED_FUNCTION(~invalid_syntax() throw(), {})
BOOST_DEFAULTED_FUNCTION(~invalid_syntax(), {})

kind_t kind() const {return m_kind;}

Expand All @@ -340,7 +340,7 @@ namespace boost { namespace program_options {
m_substitutions["invalid_line"] = invalid_line;
}

BOOST_DEFAULTED_FUNCTION(~invalid_config_file_syntax() throw(), {})
BOOST_DEFAULTED_FUNCTION(~invalid_config_file_syntax(), {})

/** Convenience functions for backwards compatibility */
virtual std::string tokens() const {return m_substitutions.find("invalid_line")->second; }
Expand All @@ -355,7 +355,7 @@ namespace boost { namespace program_options {
const std::string& original_token = "",
int option_style = 0):
invalid_syntax(kind, option_name, original_token, option_style) {}
BOOST_DEFAULTED_FUNCTION(~invalid_command_line_syntax() throw(), {})
BOOST_DEFAULTED_FUNCTION(~invalid_command_line_syntax(), {})
};


Expand All @@ -380,7 +380,7 @@ namespace boost { namespace program_options {
{
}

BOOST_DEFAULTED_FUNCTION(~validation_error() throw(), {})
BOOST_DEFAULTED_FUNCTION(~validation_error(), {})

kind_t kind() const { return m_kind; }

Expand Down
2 changes: 1 addition & 1 deletion src/value_semantic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ namespace boost { namespace program_options {
}


const char* error_with_option_name::what() const throw()
const char* error_with_option_name::what() const BOOST_NOEXCEPT_OR_NOTHROW
{
// will substitute tokens each time what is run()
substitute_placeholders(m_error_template);
Expand Down