Skip to content

Commit 95a19ea

Browse files
committed
Use BOOST_OVERRIDE on functions that override
Signed-off-by: Ben Magistro <[email protected]>
1 parent 6ccf63b commit 95a19ea

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
lines changed

include/boost/program_options/errors.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ namespace boost { namespace program_options {
183183

184184
/** Creates the error_message on the fly
185185
* Currently a thin wrapper for substitute_placeholders() */
186-
virtual const char* what() const BOOST_NOEXCEPT_OR_NOTHROW;
186+
virtual const char* what() const BOOST_NOEXCEPT_OR_NOTHROW BOOST_OVERRIDE;
187187

188188
protected:
189189
/** Used to hold the error text returned by what() */
@@ -256,7 +256,7 @@ namespace boost { namespace program_options {
256256
}
257257

258258
/** Does NOT set option name, because no option name makes sense */
259-
virtual void set_option_name(const std::string&) {}
259+
virtual void set_option_name(const std::string&) BOOST_OVERRIDE {}
260260

261261
BOOST_DEFAULTED_FUNCTION(~error_with_no_option_name() BOOST_NOEXCEPT_OR_NOTHROW, {})
262262
};
@@ -289,7 +289,7 @@ namespace boost { namespace program_options {
289289

290290
protected:
291291
/** Makes all substitutions using the template */
292-
virtual void substitute_placeholders(const std::string& error_template) const;
292+
virtual void substitute_placeholders(const std::string& error_template) const BOOST_OVERRIDE;
293293
private:
294294
// TODO: copy ctor might throw
295295
std::vector<std::string> m_alternatives;
@@ -343,7 +343,7 @@ namespace boost { namespace program_options {
343343
BOOST_DEFAULTED_FUNCTION(~invalid_config_file_syntax() BOOST_NOEXCEPT_OR_NOTHROW, {})
344344

345345
/** Convenience functions for backwards compatibility */
346-
virtual std::string tokens() const {return m_substitutions.find("invalid_line")->second; }
346+
virtual std::string tokens() const BOOST_OVERRIDE {return m_substitutions.find("invalid_line")->second; }
347347
};
348348

349349

include/boost/program_options/value_semantic.hpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ namespace boost { namespace program_options {
9292
private: // base overrides
9393
void parse(boost::any& value_store,
9494
const std::vector<std::string>& new_tokens,
95-
bool utf8) const;
95+
bool utf8) const BOOST_OVERRIDE;
9696
protected: // interface for derived classes.
9797
virtual void xparse(boost::any& value_store,
9898
const std::vector<std::string>& new_tokens)
@@ -112,7 +112,7 @@ namespace boost { namespace program_options {
112112
private: // base overrides
113113
void parse(boost::any& value_store,
114114
const std::vector<std::string>& new_tokens,
115-
bool utf8) const;
115+
bool utf8) const BOOST_OVERRIDE;
116116
protected: // interface for derived classes.
117117
#if !defined(BOOST_NO_STD_WSTRING)
118118
virtual void xparse(boost::any& value_store,
@@ -130,28 +130,28 @@ namespace boost { namespace program_options {
130130
: m_zero_tokens(zero_tokens)
131131
{}
132132

133-
std::string name() const;
133+
std::string name() const BOOST_OVERRIDE;
134134

135-
unsigned min_tokens() const;
136-
unsigned max_tokens() const;
135+
unsigned min_tokens() const BOOST_OVERRIDE;
136+
unsigned max_tokens() const BOOST_OVERRIDE;
137137

138-
bool is_composing() const { return false; }
138+
bool is_composing() const BOOST_OVERRIDE { return false; }
139139

140-
bool is_required() const { return false; }
140+
bool is_required() const BOOST_OVERRIDE { return false; }
141141

142142
/** If 'value_store' is already initialized, or new_tokens
143143
has more than one elements, throws. Otherwise, assigns
144144
the first string from 'new_tokens' to 'value_store', without
145145
any modifications.
146146
*/
147147
void xparse(boost::any& value_store,
148-
const std::vector<std::string>& new_tokens) const;
148+
const std::vector<std::string>& new_tokens) const BOOST_OVERRIDE;
149149

150150
/** Does nothing. */
151-
bool apply_default(boost::any&) const { return false; }
151+
bool apply_default(boost::any&) const BOOST_OVERRIDE { return false; }
152152

153153
/** Does nothing. */
154-
void notify(const boost::any&) const {}
154+
void notify(const boost::any&) BOOST_OVERRIDE const {}
155155
private:
156156
bool m_zero_tokens;
157157
};
@@ -299,11 +299,11 @@ namespace boost { namespace program_options {
299299

300300
public: // value semantic overrides
301301

302-
std::string name() const;
302+
std::string name() const BOOST_OVERRIDE;
303303

304-
bool is_composing() const { return m_composing; }
304+
bool is_composing() const BOOST_OVERRIDE { return m_composing; }
305305

306-
unsigned min_tokens() const
306+
unsigned min_tokens() const BOOST_OVERRIDE
307307
{
308308
if (m_zero_tokens || !m_implicit_value.empty()) {
309309
return 0;
@@ -312,7 +312,7 @@ namespace boost { namespace program_options {
312312
}
313313
}
314314

315-
unsigned max_tokens() const {
315+
unsigned max_tokens() const BOOST_OVERRIDE {
316316
if (m_multitoken) {
317317
return std::numeric_limits<unsigned>::max BOOST_PREVENT_MACRO_SUBSTITUTION();
318318
} else if (m_zero_tokens) {
@@ -322,19 +322,19 @@ namespace boost { namespace program_options {
322322
}
323323
}
324324

325-
bool is_required() const { return m_required; }
325+
bool is_required() const BOOST_OVERRIDE { return m_required; }
326326

327327
/** Creates an instance of the 'validator' class and calls
328328
its operator() to perform the actual conversion. */
329329
void xparse(boost::any& value_store,
330330
const std::vector< std::basic_string<charT> >& new_tokens)
331-
const;
331+
const BOOST_OVERRIDE;
332332

333333
/** If default value was specified via previous call to
334334
'default_value', stores that value into 'value_store'.
335335
Returns true if default value was stored.
336336
*/
337-
virtual bool apply_default(boost::any& value_store) const
337+
virtual bool apply_default(boost::any& value_store) const BOOST_OVERRIDE
338338
{
339339
if (m_default_value.empty()) {
340340
return false;
@@ -347,12 +347,12 @@ namespace boost { namespace program_options {
347347
/** If an address of variable to store value was specified
348348
when creating *this, stores the value there. Otherwise,
349349
does nothing. */
350-
void notify(const boost::any& value_store) const;
350+
void notify(const boost::any& value_store) const BOOST_OVERRIDE;
351351

352352
public: // typed_value_base overrides
353353

354354
#ifndef BOOST_NO_RTTI
355-
const std::type_info& value_type() const
355+
const std::type_info& value_type() const BOOST_OVERRIDE
356356
{
357357
return typeid(T);
358358
}

include/boost/program_options/variables_map.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ namespace boost { namespace program_options {
162162
private:
163163
/** Implementation of abstract_variables_map::get
164164
which does 'find' in *this. */
165-
const variable_value& get(const std::string& name) const;
165+
const variable_value& get(const std::string& name) const BOOST_OVERRIDE;
166166

167167
/** Names of option with 'final' values \-- which should not
168168
be changed by subsequence assignments. */

0 commit comments

Comments
 (0)