diff --git a/include/boost/program_options/errors.hpp b/include/boost/program_options/errors.hpp index 56674bf24..4b2655fa3 100644 --- a/include/boost/program_options/errors.hpp +++ b/include/boost/program_options/errors.hpp @@ -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 BOOST_NOEXCEPT_OR_NOTHROW; + virtual const char* what() const BOOST_NOEXCEPT_OR_NOTHROW BOOST_OVERRIDE; protected: /** Used to hold the error text returned by what() */ @@ -256,7 +256,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&) {} + virtual void set_option_name(const std::string&) BOOST_OVERRIDE {} BOOST_DEFAULTED_FUNCTION(~error_with_no_option_name() BOOST_NOEXCEPT_OR_NOTHROW, {}) }; @@ -289,7 +289,7 @@ namespace boost { namespace program_options { protected: /** Makes all substitutions using the template */ - virtual void substitute_placeholders(const std::string& error_template) const; + virtual void substitute_placeholders(const std::string& error_template) const BOOST_OVERRIDE; private: // TODO: copy ctor might throw std::vector m_alternatives; @@ -343,7 +343,7 @@ namespace boost { namespace program_options { BOOST_DEFAULTED_FUNCTION(~invalid_config_file_syntax() BOOST_NOEXCEPT_OR_NOTHROW, {}) /** Convenience functions for backwards compatibility */ - virtual std::string tokens() const {return m_substitutions.find("invalid_line")->second; } + virtual std::string tokens() const BOOST_OVERRIDE {return m_substitutions.find("invalid_line")->second; } }; diff --git a/include/boost/program_options/value_semantic.hpp b/include/boost/program_options/value_semantic.hpp index ac9dbc663..4feff3bd1 100644 --- a/include/boost/program_options/value_semantic.hpp +++ b/include/boost/program_options/value_semantic.hpp @@ -92,7 +92,7 @@ namespace boost { namespace program_options { private: // base overrides void parse(boost::any& value_store, const std::vector& new_tokens, - bool utf8) const; + bool utf8) const BOOST_OVERRIDE; protected: // interface for derived classes. virtual void xparse(boost::any& value_store, const std::vector& new_tokens) @@ -112,7 +112,7 @@ namespace boost { namespace program_options { private: // base overrides void parse(boost::any& value_store, const std::vector& new_tokens, - bool utf8) const; + bool utf8) const BOOST_OVERRIDE; protected: // interface for derived classes. #if !defined(BOOST_NO_STD_WSTRING) virtual void xparse(boost::any& value_store, @@ -130,14 +130,14 @@ namespace boost { namespace program_options { : m_zero_tokens(zero_tokens) {} - std::string name() const; + std::string name() const BOOST_OVERRIDE; - unsigned min_tokens() const; - unsigned max_tokens() const; + unsigned min_tokens() const BOOST_OVERRIDE; + unsigned max_tokens() const BOOST_OVERRIDE; - bool is_composing() const { return false; } + bool is_composing() const BOOST_OVERRIDE { return false; } - bool is_required() const { return false; } + bool is_required() const BOOST_OVERRIDE { return false; } /** If 'value_store' is already initialized, or new_tokens has more than one elements, throws. Otherwise, assigns @@ -145,13 +145,13 @@ namespace boost { namespace program_options { any modifications. */ void xparse(boost::any& value_store, - const std::vector& new_tokens) const; + const std::vector& new_tokens) const BOOST_OVERRIDE; /** Does nothing. */ - bool apply_default(boost::any&) const { return false; } + bool apply_default(boost::any&) const BOOST_OVERRIDE { return false; } /** Does nothing. */ - void notify(const boost::any&) const {} + void notify(const boost::any&) BOOST_OVERRIDE const {} private: bool m_zero_tokens; }; @@ -299,11 +299,11 @@ namespace boost { namespace program_options { public: // value semantic overrides - std::string name() const; + std::string name() const BOOST_OVERRIDE; - bool is_composing() const { return m_composing; } + bool is_composing() const BOOST_OVERRIDE { return m_composing; } - unsigned min_tokens() const + unsigned min_tokens() const BOOST_OVERRIDE { if (m_zero_tokens || !m_implicit_value.empty()) { return 0; @@ -312,7 +312,7 @@ namespace boost { namespace program_options { } } - unsigned max_tokens() const { + unsigned max_tokens() const BOOST_OVERRIDE { if (m_multitoken) { return std::numeric_limits::max BOOST_PREVENT_MACRO_SUBSTITUTION(); } else if (m_zero_tokens) { @@ -322,19 +322,19 @@ namespace boost { namespace program_options { } } - bool is_required() const { return m_required; } + bool is_required() const BOOST_OVERRIDE { return m_required; } /** Creates an instance of the 'validator' class and calls its operator() to perform the actual conversion. */ void xparse(boost::any& value_store, const std::vector< std::basic_string >& new_tokens) - const; + const BOOST_OVERRIDE; /** If default value was specified via previous call to 'default_value', stores that value into 'value_store'. Returns true if default value was stored. */ - virtual bool apply_default(boost::any& value_store) const + virtual bool apply_default(boost::any& value_store) const BOOST_OVERRIDE { if (m_default_value.empty()) { return false; @@ -347,12 +347,12 @@ namespace boost { namespace program_options { /** If an address of variable to store value was specified when creating *this, stores the value there. Otherwise, does nothing. */ - void notify(const boost::any& value_store) const; + void notify(const boost::any& value_store) const BOOST_OVERRIDE; public: // typed_value_base overrides #ifndef BOOST_NO_RTTI - const std::type_info& value_type() const + const std::type_info& value_type() const BOOST_OVERRIDE { return typeid(T); } diff --git a/include/boost/program_options/variables_map.hpp b/include/boost/program_options/variables_map.hpp index 362dedf28..e40453895 100644 --- a/include/boost/program_options/variables_map.hpp +++ b/include/boost/program_options/variables_map.hpp @@ -162,7 +162,7 @@ namespace boost { namespace program_options { private: /** Implementation of abstract_variables_map::get which does 'find' in *this. */ - const variable_value& get(const std::string& name) const; + const variable_value& get(const std::string& name) const BOOST_OVERRIDE; /** Names of option with 'final' values \-- which should not be changed by subsequence assignments. */