From: Mikko Rasa Date: Sun, 31 Oct 2021 19:12:00 +0000 (+0200) Subject: Mark empty constructors and destructors as defaulted X-Git-Url: http://git.tdb.fi/?p=libs%2Fdatafile.git;a=commitdiff_plain;h=a2cce9e933089f483163456e9872e005c33dd678 Mark empty constructors and destructors as defaulted --- diff --git a/source/collection.h b/source/collection.h index 4a2f736..db4e50a 100644 --- a/source/collection.h +++ b/source/collection.h @@ -335,7 +335,7 @@ class CollectionItemTypeBase protected: struct ExtractorBase { - virtual ~ExtractorBase() { } + virtual ~ExtractorBase() = default; }; template @@ -348,7 +348,7 @@ protected: std::vector suffixes; std::vector extractors; - CollectionItemTypeBase() { } + CollectionItemTypeBase() = default; public: virtual ~CollectionItemTypeBase(); diff --git a/source/collectionsource.h b/source/collectionsource.h index e5647d8..eeff10a 100644 --- a/source/collectionsource.h +++ b/source/collectionsource.h @@ -21,9 +21,9 @@ public: typedef std::list NameList; protected: - CollectionSource() { } + CollectionSource() = default; public: - virtual ~CollectionSource() { } + virtual ~CollectionSource() = default; /// Determines whether an object is available from this source. virtual bool is_loadable(const CollectionItemTypeBase &type, const std::string &name) const = 0; diff --git a/source/except.h b/source/except.h index 34d9e77..7107fe1 100644 --- a/source/except.h +++ b/source/except.h @@ -18,7 +18,7 @@ public: data_error(const std::string &, unsigned, const std::string &); data_error(const std::string &, unsigned, const std::exception &); data_error(const std::string &, unsigned, const data_error &); - virtual ~data_error() throw() { } + virtual ~data_error() throw() = default; const std::string &get_source() const { return source; } unsigned get_line() const { return line; } @@ -32,7 +32,7 @@ class parse_error: public std::runtime_error { public: parse_error(const std::string &); - virtual ~parse_error() throw() { } + virtual ~parse_error() throw() = default; }; @@ -40,7 +40,7 @@ class syntax_error: public std::runtime_error { public: syntax_error(const std::string &t); - virtual ~syntax_error() throw() { } + virtual ~syntax_error() throw() = default; }; @@ -48,7 +48,7 @@ class bad_definition: public std::runtime_error { public: bad_definition(const std::string &w); - virtual ~bad_definition() throw() { } + virtual ~bad_definition() throw() = default; }; @@ -56,7 +56,7 @@ class nesting_error: public std::logic_error { public: nesting_error(const std::string &); - virtual ~nesting_error() throw() { } + virtual ~nesting_error() throw() = default; }; @@ -64,7 +64,7 @@ class unknown_keyword: public std::runtime_error { public: unknown_keyword(const std::string &); - virtual ~unknown_keyword() throw() { } + virtual ~unknown_keyword() throw() = default; }; @@ -72,7 +72,7 @@ class invalid_signature: public std::runtime_error { public: invalid_signature(const std::string &, const std::string &); - virtual ~invalid_signature() throw() { } + virtual ~invalid_signature() throw() = default; }; diff --git a/source/loader.h b/source/loader.h index 85e26d9..24cd7df 100644 --- a/source/loader.h +++ b/source/loader.h @@ -57,7 +57,7 @@ protected: Loader(); public: - virtual ~Loader() { } + virtual ~Loader() = default; /** Loads statements from a parser. */ void load(Parser &p); diff --git a/source/loaderaction.h b/source/loaderaction.h index 4666687..9d5baae 100644 --- a/source/loaderaction.h +++ b/source/loaderaction.h @@ -24,9 +24,9 @@ Base class for loader actions. class LoaderAction { protected: - LoaderAction() { } + LoaderAction() = default; public: - virtual ~LoaderAction() { } + virtual ~LoaderAction() = default; /** Called to process a statement. */ virtual void execute(Loader &, const Statement &) const = 0; diff --git a/source/packsource.h b/source/packsource.h index 3694a3b..67c14f5 100644 --- a/source/packsource.h +++ b/source/packsource.h @@ -120,7 +120,7 @@ private: ObjectMap objects; public: - PackSource() { } + PackSource() = default; PackSource(const PackSource &); PackSource &operator=(const PackSource &); private: diff --git a/source/parsermode.h b/source/parsermode.h index 9d47ae4..319b0f1 100644 --- a/source/parsermode.h +++ b/source/parsermode.h @@ -22,7 +22,7 @@ protected: ParserMode(Input &i, const std::string &s): in(i), src(s) { } public: - virtual ~ParserMode() { } + virtual ~ParserMode() = default; virtual Statement parse() = 0; virtual void process_control_statement(const Statement &) { } diff --git a/source/statement.h b/source/statement.h index 3aa6004..cd1797c 100644 --- a/source/statement.h +++ b/source/statement.h @@ -45,7 +45,7 @@ struct StatementKey std::string keyword; std::string signature; - StatementKey() { } + StatementKey() = default; StatementKey(const std::string &k, const std::string &s): keyword(k), signature(s) { } bool operator<(const StatementKey &o) const diff --git a/source/type.h b/source/type.h index 151f2ca..0e371e6 100644 --- a/source/type.h +++ b/source/type.h @@ -12,7 +12,7 @@ struct Symbol { std::string name; - Symbol() { } + Symbol() = default; template Symbol(const T &n): name(lexical_cast(n)) { } diff --git a/source/writermode.h b/source/writermode.h index 614de98..3f898bb 100644 --- a/source/writermode.h +++ b/source/writermode.h @@ -16,7 +16,7 @@ protected: WriterMode(Output &o): out(o) { } public: - virtual ~WriterMode() { } + virtual ~WriterMode() = default; virtual void set_float_precision(unsigned) = 0; virtual void write(const Statement &st) = 0;