C++11: override keyword
Source : http://en.cppreference.com/w/cpp/language/override
diff --git a/include/json/reader.h b/include/json/reader.h
index c07ce19..9a8a4e3 100644
--- a/include/json/reader.h
+++ b/include/json/reader.h
@@ -333,9 +333,9 @@
Json::Value settings_;
CharReaderBuilder();
- virtual ~CharReaderBuilder();
+ ~CharReaderBuilder() override;
- virtual CharReader* newCharReader() const;
+ CharReader* newCharReader() const override;
/** \return true if 'settings' are legal and consistent;
* otherwise, indicate bad settings via 'invalid'.
diff --git a/include/json/value.h b/include/json/value.h
index 8e996ae..1ab22ef 100644
--- a/include/json/value.h
+++ b/include/json/value.h
@@ -40,8 +40,8 @@
class JSON_API Exception : public std::exception {
public:
Exception(std::string const& msg);
- virtual ~Exception() throw();
- virtual char const* what() const throw();
+ ~Exception() throw() override;
+ char const* what() const throw() override;
protected:
std::string const msg_;
};
diff --git a/include/json/writer.h b/include/json/writer.h
index 39bfa9b..f94aa1f 100644
--- a/include/json/writer.h
+++ b/include/json/writer.h
@@ -112,12 +112,12 @@
Json::Value settings_;
StreamWriterBuilder();
- virtual ~StreamWriterBuilder();
+ ~StreamWriterBuilder() override;
/**
* \throw std::exception if something goes wrong (e.g. invalid settings)
*/
- virtual StreamWriter* newStreamWriter() const;
+ StreamWriter* newStreamWriter() const override;
/** \return true if 'settings' are legal and consistent;
* otherwise, indicate bad settings via 'invalid'.
@@ -158,7 +158,7 @@
public:
FastWriter();
- virtual ~FastWriter() {}
+ ~FastWriter() override {}
void enableYAMLCompatibility();
@@ -172,7 +172,7 @@
void omitEndingLineFeed();
public: // overridden from Writer
- virtual std::string write(const Value& root);
+ std::string write(const Value& root) override;
private:
void writeValue(const Value& value);
@@ -210,14 +210,14 @@
class JSON_API StyledWriter : public Writer {
public:
StyledWriter();
- virtual ~StyledWriter() {}
+ ~StyledWriter() override {}
public: // overridden from Writer
/** \brief Serialize a Value in <a HREF="http://www.json.org">JSON</a> format.
* \param root Value to serialize.
* \return String containing the JSON document that represents the root value.
*/
- virtual std::string write(const Value& root);
+ std::string write(const Value& root) override;
private:
void writeValue(const Value& value);