From 15e7b88029a00c05dc3951a49440cbe5c2465e37 Mon Sep 17 00:00:00 2001 From: Tomas Pecka <peckato1@fit.cvut.cz> Date: Fri, 24 May 2019 15:01:36 +0200 Subject: [PATCH] Use =default instead of trivial constructor --- .../abstraction/AnyaryOperationAbstraction.hpp | 3 +-- .../src/abstraction/OperationAbstraction.hpp | 3 +-- .../src/registry/AlgorithmRegistry.hpp | 12 ++++-------- alib2abstraction/src/registry/CastRegistry.hpp | 6 ++---- .../src/registry/ContainerRegistry.hpp | 6 ++---- .../src/registry/ImmediateRegistry.hpp | 9 +++------ .../src/registry/NormalizeRegistry.hpp | 9 +++------ .../src/registry/ValuePrinterRegistry.hpp | 9 +++------ alib2cli/src/ast/Arg.h | 3 +-- alib2cli/src/ast/Option.h | 3 +-- alib2cli/src/ast/Statement.h | 3 +-- .../src/ast/statements/ResultPrintStatement.h | 3 +-- alib2cli/src/command/Command.h | 3 +-- alib2cli/src/environment/Environment.h | 3 +-- alib2cli/src/registry/InputFileRegistry.hpp | 6 ++---- alib2cli/src/registry/OutputFileRegistry.hpp | 6 ++---- alib2common/src/core/components.hpp | 9 +++------ alib2common/src/core/components/setComponents.hpp | 6 ++---- alib2common/src/object/Void.cpp | 4 +--- alib2data/src/alphabet/BarSymbol.cpp | 4 +--- alib2data/src/alphabet/BlankSymbol.cpp | 4 +--- alib2data/src/alphabet/BottomOfTheStackSymbol.cpp | 4 +--- alib2data/src/alphabet/EndSymbol.cpp | 4 +--- alib2data/src/alphabet/InitialSymbol.cpp | 4 +--- alib2data/src/alphabet/StartSymbol.cpp | 4 +--- alib2data/src/alphabet/VariablesBarSymbol.cpp | 3 +-- alib2data/src/alphabet/WildcardSymbol.cpp | 4 +--- alib2data/src/common/symbol_or_epsilon.hpp | 3 +-- alib2data/src/label/FailStateLabel.cpp | 4 +--- alib2data/src/label/FinalStateLabel.cpp | 3 +-- alib2data/src/label/InitialStateLabel.cpp | 4 +--- alib2graph_data/src/edge/EdgeBase.hpp | 3 +-- alib2graph_data/src/graph/GraphBase.hpp | 3 +-- alib2graph_data/src/grid/GridBase.hpp | 3 +-- alib2graph_data/src/node/NodeBase.hpp | 3 +-- alib2gui/src/MainWindow.cpp | 4 +--- alib2measure/src/allocator/StealthAllocator.hpp | 2 +- .../src/measurements/MeasurementResults.cpp | 3 +-- alib2raw/src/registry/RawReaderRegistry.hpp | 6 ++---- alib2raw/src/registry/RawWriterRegistry.hpp | 9 +++------ alib2std/src/extensions/container/tree.hpp | 3 +-- alib2std/src/extensions/container/tree_base.hpp | 15 +++++---------- alib2std/src/extensions/container/trie.hpp | 3 +-- alib2std/src/extensions/fdstream.cpp | 6 ++---- alib2std/src/extensions/range.hpp | 3 +-- alib2str/src/core/stringApi.hpp | 6 ++---- alib2str/src/registry/StringReaderRegistry.hpp | 9 +++------ alib2str/src/registry/StringWriterRegistry.hpp | 9 +++------ alib2xml/src/registry/XmlComposerRegistry.hpp | 9 +++------ .../src/registry/XmlContainerParserRegistry.hpp | 6 ++---- alib2xml/src/registry/XmlParserRegistry.hpp | 9 +++------ 51 files changed, 85 insertions(+), 180 deletions(-) diff --git a/alib2abstraction/src/abstraction/AnyaryOperationAbstraction.hpp b/alib2abstraction/src/abstraction/AnyaryOperationAbstraction.hpp index a16bc60935..eeb5de007e 100644 --- a/alib2abstraction/src/abstraction/AnyaryOperationAbstraction.hpp +++ b/alib2abstraction/src/abstraction/AnyaryOperationAbstraction.hpp @@ -48,8 +48,7 @@ private: } public: - AnyaryOperationAbstraction ( ) { - } + AnyaryOperationAbstraction ( ) = default; bool inputsAttached ( ) const override { auto attached_lambda = [ ] ( const std::pair < std::shared_ptr < OperationAbstraction >, bool > & param ) { diff --git a/alib2abstraction/src/abstraction/OperationAbstraction.hpp b/alib2abstraction/src/abstraction/OperationAbstraction.hpp index 9ab0e32e48..64686445df 100644 --- a/alib2abstraction/src/abstraction/OperationAbstraction.hpp +++ b/alib2abstraction/src/abstraction/OperationAbstraction.hpp @@ -25,8 +25,7 @@ public: virtual bool attachInput ( const std::shared_ptr < OperationAbstraction > & input, unsigned index, bool move, bool checkInput ) = 0; virtual bool detachInput ( unsigned index ) = 0; - virtual ~OperationAbstraction ( ) noexcept { - } + virtual ~OperationAbstraction ( ) noexcept = default; virtual bool inputsAttached ( ) const = 0; virtual bool eval ( ) = 0; diff --git a/alib2abstraction/src/registry/AlgorithmRegistry.hpp b/alib2abstraction/src/registry/AlgorithmRegistry.hpp index 153a4fec84..344644bd95 100644 --- a/alib2abstraction/src/registry/AlgorithmRegistry.hpp +++ b/alib2abstraction/src/registry/AlgorithmRegistry.hpp @@ -39,8 +39,7 @@ public: Entry ( AlgorithmFullInfo entryInfo ) : m_entryInfo ( std::move ( entryInfo ) ), m_documentation ( "Documentation not avaiable." ) { } - virtual ~Entry ( ) { - } + virtual ~Entry ( ) = default; virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const = 0; @@ -66,8 +65,7 @@ private: MemberImpl ( std::array < std::string, sizeof ... ( Params ) > paramNames, std::function < Return ( typename std::remove_reference < ObjectType >::type *, Params ... ) > callback ) : Entry ( AlgorithmFullInfo::methodEntryInfo < ObjectType, Return, Params ... > ( std::move ( paramNames ) ) ), m_callback ( callback ) { } - virtual ~MemberImpl ( ) { - } + virtual ~MemberImpl ( ) = default; std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const override; }; @@ -80,8 +78,7 @@ private: EntryImpl ( AlgorithmCategories::AlgorithmCategory category, std::array < std::string, sizeof ... ( Params ) > paramNames, std::function < Return ( Params ... ) > callback ) : Entry ( AlgorithmFullInfo::algorithmEntryInfo < Return, Params ... > ( category, std::move ( paramNames ) ) ), m_callback ( callback ) { } - virtual ~EntryImpl ( ) { - } + virtual ~EntryImpl ( ) = default; std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const override; }; @@ -94,8 +91,7 @@ private: WrapperImpl ( std::array < std::string, sizeof ... ( Params ) > paramNames, std::function < std::shared_ptr < abstraction::OperationAbstraction > ( Params ... ) > wrapperFinder ) : Entry ( AlgorithmFullInfo::wrapperEntryInfo < Return, Params ... > ( std::move ( paramNames ) ) ), m_wrapperFinder ( wrapperFinder ) { } - virtual ~WrapperImpl ( ) { - } + virtual ~WrapperImpl ( ) = default; std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const override; }; diff --git a/alib2abstraction/src/registry/CastRegistry.hpp b/alib2abstraction/src/registry/CastRegistry.hpp index e0c12e1fb0..6e4271517e 100644 --- a/alib2abstraction/src/registry/CastRegistry.hpp +++ b/alib2abstraction/src/registry/CastRegistry.hpp @@ -32,8 +32,7 @@ public: virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const = 0; - virtual ~Entry ( ) { - } + virtual ~Entry ( ) = default; bool isExplicit ( ) { return m_isExplicit; @@ -59,8 +58,7 @@ private: AlgorithmEntryImpl ( std::function < Return ( Param ) > callback, bool isExplicit ) : Entry ( isExplicit ), m_callback ( callback ) { } - virtual ~AlgorithmEntryImpl ( ) { - } + virtual ~AlgorithmEntryImpl ( ) = default; std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const override; }; diff --git a/alib2abstraction/src/registry/ContainerRegistry.hpp b/alib2abstraction/src/registry/ContainerRegistry.hpp index 717d7e0943..7e14309401 100644 --- a/alib2abstraction/src/registry/ContainerRegistry.hpp +++ b/alib2abstraction/src/registry/ContainerRegistry.hpp @@ -27,8 +27,7 @@ public: public: virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const = 0; - virtual ~Entry ( ) { - } + virtual ~Entry ( ) = default; }; private: @@ -37,8 +36,7 @@ private: public: std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const override; - virtual ~SetEntryImpl ( ) { - } + virtual ~SetEntryImpl ( ) = default; }; static ext::map < std::string, ext::list < ext::pair < std::string, std::unique_ptr < Entry > > > > & getEntries ( ); diff --git a/alib2abstraction/src/registry/ImmediateRegistry.hpp b/alib2abstraction/src/registry/ImmediateRegistry.hpp index 7a9a9a2520..9623961e00 100644 --- a/alib2abstraction/src/registry/ImmediateRegistry.hpp +++ b/alib2abstraction/src/registry/ImmediateRegistry.hpp @@ -24,19 +24,16 @@ public: public: virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( std::string value ) const = 0; - virtual ~Entry ( ) { - } + virtual ~Entry ( ) = default; }; private: template < class Result > class EntryImpl : public Entry { public: - EntryImpl ( ) { - } + EntryImpl ( ) = default; - virtual ~EntryImpl ( ) { - } + virtual ~EntryImpl ( ) = default; std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( std::string value ) const override; }; diff --git a/alib2abstraction/src/registry/NormalizeRegistry.hpp b/alib2abstraction/src/registry/NormalizeRegistry.hpp index d249607de3..f0afc3d60c 100644 --- a/alib2abstraction/src/registry/NormalizeRegistry.hpp +++ b/alib2abstraction/src/registry/NormalizeRegistry.hpp @@ -27,8 +27,7 @@ public: public: virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const = 0; - virtual ~Entry ( ) { - } + virtual ~Entry ( ) = default; }; @@ -36,11 +35,9 @@ private: template < class Param > class EntryImpl : public Entry { public: - EntryImpl ( ) { - } + EntryImpl ( ) = default; - virtual ~EntryImpl ( ) { - } + virtual ~EntryImpl ( ) = default; std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const override; }; diff --git a/alib2abstraction/src/registry/ValuePrinterRegistry.hpp b/alib2abstraction/src/registry/ValuePrinterRegistry.hpp index d46d2c4d8c..7c0fd3eb20 100644 --- a/alib2abstraction/src/registry/ValuePrinterRegistry.hpp +++ b/alib2abstraction/src/registry/ValuePrinterRegistry.hpp @@ -23,8 +23,7 @@ public: public: virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( std::ostream & os ) const = 0; - virtual ~Entry ( ) { - } + virtual ~Entry ( ) = default; }; @@ -32,11 +31,9 @@ private: template < class Param > class EntryImpl : public Entry { public: - EntryImpl ( ) { - } + EntryImpl ( ) = default; - virtual ~EntryImpl ( ) { - } + virtual ~EntryImpl ( ) = default; std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( std::ostream & os ) const override; }; diff --git a/alib2cli/src/ast/Arg.h b/alib2cli/src/ast/Arg.h index a8b7941b44..97c732a708 100644 --- a/alib2cli/src/ast/Arg.h +++ b/alib2cli/src/ast/Arg.h @@ -7,8 +7,7 @@ namespace cli { class Arg { public: - virtual ~Arg ( ) noexcept { - } + virtual ~Arg ( ) noexcept = default; virtual std::string eval ( Environment & environment ) const = 0; }; diff --git a/alib2cli/src/ast/Option.h b/alib2cli/src/ast/Option.h index 48a1f21691..9abaf3ca0b 100644 --- a/alib2cli/src/ast/Option.h +++ b/alib2cli/src/ast/Option.h @@ -5,8 +5,7 @@ namespace cli { class Option { public: - virtual ~Option ( ) noexcept { - } + virtual ~Option ( ) noexcept = default; }; } /* namespace cli */ diff --git a/alib2cli/src/ast/Statement.h b/alib2cli/src/ast/Statement.h index 5fab817158..cffb0e994e 100644 --- a/alib2cli/src/ast/Statement.h +++ b/alib2cli/src/ast/Statement.h @@ -9,8 +9,7 @@ namespace cli { class Statement : public std::enable_shared_from_this < Statement > { public: - virtual ~Statement ( ) noexcept { - } + virtual ~Statement ( ) noexcept = default; virtual std::shared_ptr < abstraction::OperationAbstraction > translateAndEval ( const std::shared_ptr < abstraction::OperationAbstraction > & prev, Environment & environment ) const = 0; diff --git a/alib2cli/src/ast/statements/ResultPrintStatement.h b/alib2cli/src/ast/statements/ResultPrintStatement.h index 07cf9fd4f9..54a3fe4f57 100644 --- a/alib2cli/src/ast/statements/ResultPrintStatement.h +++ b/alib2cli/src/ast/statements/ResultPrintStatement.h @@ -9,8 +9,7 @@ namespace cli { class ResultPrintStatement final : public Statement { public: - ResultPrintStatement ( ) { - } + ResultPrintStatement ( ) = default; std::shared_ptr < abstraction::OperationAbstraction > translateAndEval ( const std::shared_ptr < abstraction::OperationAbstraction > & prev, Environment & ) const override { std::shared_ptr < abstraction::OperationAbstraction > res = abstraction::Registry::getValuePrinterAbstraction ( prev->getReturnType ( ), common::Streams::out ); diff --git a/alib2cli/src/command/Command.h b/alib2cli/src/command/Command.h index 3c2b6b581c..5f248d4e9a 100644 --- a/alib2cli/src/command/Command.h +++ b/alib2cli/src/command/Command.h @@ -14,8 +14,7 @@ public: ERROR }; - virtual ~Command ( ) noexcept { - } + virtual ~Command ( ) noexcept = default; virtual Command::Result run ( Environment & environment ) const = 0; }; diff --git a/alib2cli/src/environment/Environment.h b/alib2cli/src/environment/Environment.h index 3bb565188f..a51e4eefec 100644 --- a/alib2cli/src/environment/Environment.h +++ b/alib2cli/src/environment/Environment.h @@ -37,8 +37,7 @@ class Environment { } public: - Environment ( ) { - } + Environment ( ) = default; Environment ( std::unique_ptr < Environment > upper ) : m_upper ( std::move ( upper ) ) { } diff --git a/alib2cli/src/registry/InputFileRegistry.hpp b/alib2cli/src/registry/InputFileRegistry.hpp index 248e0b03fb..dd734c6791 100644 --- a/alib2cli/src/registry/InputFileRegistry.hpp +++ b/alib2cli/src/registry/InputFileRegistry.hpp @@ -23,8 +23,7 @@ class InputFileRegistry { public: virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( const std::string & type, const ext::vector < std::string > & templateParams ) const = 0; - virtual ~Entry ( ) { - } + virtual ~Entry ( ) = default; }; class EntryImpl : public Entry { @@ -33,8 +32,7 @@ class InputFileRegistry { EntryImpl ( std::shared_ptr < abstraction::OperationAbstraction > ( * callback ) ( const std::string & type, const ext::vector < std::string > & templateParams ) ) : m_callback ( callback ) { } - virtual ~EntryImpl ( ) { - } + virtual ~EntryImpl ( ) = default; std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( const std::string & type, const ext::vector < std::string > & templateParams ) const override; }; diff --git a/alib2cli/src/registry/OutputFileRegistry.hpp b/alib2cli/src/registry/OutputFileRegistry.hpp index c01e5d7d1c..2efc3e3216 100644 --- a/alib2cli/src/registry/OutputFileRegistry.hpp +++ b/alib2cli/src/registry/OutputFileRegistry.hpp @@ -23,8 +23,7 @@ class OutputFileRegistry { public: virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( const std::string & typehint ) const = 0; - virtual ~Entry ( ) { - } + virtual ~Entry ( ) = default; }; class EntryImpl : public Entry { @@ -33,8 +32,7 @@ class OutputFileRegistry { EntryImpl ( std::shared_ptr < abstraction::OperationAbstraction > ( * callback ) ( const std::string & typehint ) ) : m_callback ( callback ) { } - virtual ~EntryImpl ( ) { - } + virtual ~EntryImpl ( ) = default; std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( const std::string & typehint ) const override; }; diff --git a/alib2common/src/core/components.hpp b/alib2common/src/core/components.hpp index c34dd2ad08..756b01de57 100644 --- a/alib2common/src/core/components.hpp +++ b/alib2common/src/core/components.hpp @@ -208,8 +208,7 @@ public: /** * Allow less initialization values then number of components. They need to allow to be defaulty constructed then. */ - Components ( ) { - } + Components ( ) = default; /** * Construct an alphabet pack from two alphabets. @@ -255,8 +254,7 @@ public: /** * Allow less initialization values then number of components. They need to allow to be defaulty constructed then. */ - Components ( ) { - } + Components ( ) = default; /** * Construct an alphabet pack from two alphabets. @@ -302,8 +300,7 @@ public: /** * Allow less initialization values then number of components. They need to allow to be defaulty constructed then. */ - Components ( ) { - } + Components ( ) = default; /** * Construct an alphabet pack from two alphabets. diff --git a/alib2common/src/core/components/setComponents.hpp b/alib2common/src/core/components/setComponents.hpp index d2a55da17a..24dd227e0d 100644 --- a/alib2common/src/core/components/setComponents.hpp +++ b/alib2common/src/core/components/setComponents.hpp @@ -117,8 +117,7 @@ public: /** * Constructs a empty set. */ - SetComponent ( ) { - } + SetComponent ( ) = default; /** * Adds an elements to the set. @@ -233,8 +232,7 @@ public: /** * Allow default construction of this component. */ - Component ( ) { - } + Component ( ) = default; /** * Register this component's accessors to abstraction diff --git a/alib2common/src/object/Void.cpp b/alib2common/src/object/Void.cpp index 4e50868afc..66e17264f8 100644 --- a/alib2common/src/object/Void.cpp +++ b/alib2common/src/object/Void.cpp @@ -11,9 +11,7 @@ namespace object { -Void::Void() { - -} +Void::Void() = default; int Void::compare(const Void&) const { return 0; diff --git a/alib2data/src/alphabet/BarSymbol.cpp b/alib2data/src/alphabet/BarSymbol.cpp index 38f655714f..f02672e1b8 100644 --- a/alib2data/src/alphabet/BarSymbol.cpp +++ b/alib2data/src/alphabet/BarSymbol.cpp @@ -13,9 +13,7 @@ namespace alphabet { -BarSymbol::BarSymbol() { - -} +BarSymbol::BarSymbol() = default; int BarSymbol::compare(const BarSymbol&) const { return 0; diff --git a/alib2data/src/alphabet/BlankSymbol.cpp b/alib2data/src/alphabet/BlankSymbol.cpp index 0cb8c18fc2..d44ad8caf9 100644 --- a/alib2data/src/alphabet/BlankSymbol.cpp +++ b/alib2data/src/alphabet/BlankSymbol.cpp @@ -13,9 +13,7 @@ namespace alphabet { -BlankSymbol::BlankSymbol() { - -} +BlankSymbol::BlankSymbol() = default; int BlankSymbol::compare(const BlankSymbol&) const { return 0; diff --git a/alib2data/src/alphabet/BottomOfTheStackSymbol.cpp b/alib2data/src/alphabet/BottomOfTheStackSymbol.cpp index cd39f89daa..95bafebc9a 100644 --- a/alib2data/src/alphabet/BottomOfTheStackSymbol.cpp +++ b/alib2data/src/alphabet/BottomOfTheStackSymbol.cpp @@ -13,9 +13,7 @@ namespace alphabet { -BottomOfTheStackSymbol::BottomOfTheStackSymbol() { - -} +BottomOfTheStackSymbol::BottomOfTheStackSymbol() = default; int BottomOfTheStackSymbol::compare(const BottomOfTheStackSymbol&) const { return 0; diff --git a/alib2data/src/alphabet/EndSymbol.cpp b/alib2data/src/alphabet/EndSymbol.cpp index e46c4a121b..f57613f3cc 100644 --- a/alib2data/src/alphabet/EndSymbol.cpp +++ b/alib2data/src/alphabet/EndSymbol.cpp @@ -13,9 +13,7 @@ namespace alphabet { -EndSymbol::EndSymbol() { - -} +EndSymbol::EndSymbol() = default; int EndSymbol::compare(const EndSymbol&) const { return 0; diff --git a/alib2data/src/alphabet/InitialSymbol.cpp b/alib2data/src/alphabet/InitialSymbol.cpp index 66b7ff87f0..c4b99503c0 100644 --- a/alib2data/src/alphabet/InitialSymbol.cpp +++ b/alib2data/src/alphabet/InitialSymbol.cpp @@ -13,9 +13,7 @@ namespace alphabet { -InitialSymbol::InitialSymbol() { - -} +InitialSymbol::InitialSymbol() = default; int InitialSymbol::compare(const InitialSymbol&) const { return 0; diff --git a/alib2data/src/alphabet/StartSymbol.cpp b/alib2data/src/alphabet/StartSymbol.cpp index ed87c77a49..7aa6e0eaa1 100644 --- a/alib2data/src/alphabet/StartSymbol.cpp +++ b/alib2data/src/alphabet/StartSymbol.cpp @@ -13,9 +13,7 @@ namespace alphabet { -StartSymbol::StartSymbol() { - -} +StartSymbol::StartSymbol() = default; int StartSymbol::compare(const StartSymbol&) const { return 0; diff --git a/alib2data/src/alphabet/VariablesBarSymbol.cpp b/alib2data/src/alphabet/VariablesBarSymbol.cpp index eec78dab1a..d21d0b6d32 100644 --- a/alib2data/src/alphabet/VariablesBarSymbol.cpp +++ b/alib2data/src/alphabet/VariablesBarSymbol.cpp @@ -13,8 +13,7 @@ namespace alphabet { -VariablesBarSymbol::VariablesBarSymbol ( ) { -} +VariablesBarSymbol::VariablesBarSymbol ( ) = default; int VariablesBarSymbol::compare ( const VariablesBarSymbol & ) const { return 0; diff --git a/alib2data/src/alphabet/WildcardSymbol.cpp b/alib2data/src/alphabet/WildcardSymbol.cpp index 4c596228a0..fbf67b813a 100644 --- a/alib2data/src/alphabet/WildcardSymbol.cpp +++ b/alib2data/src/alphabet/WildcardSymbol.cpp @@ -13,9 +13,7 @@ namespace alphabet { -WildcardSymbol::WildcardSymbol() { - -} +WildcardSymbol::WildcardSymbol() = default; int WildcardSymbol::compare(const WildcardSymbol&) const { return 0; diff --git a/alib2data/src/common/symbol_or_epsilon.hpp b/alib2data/src/common/symbol_or_epsilon.hpp index b58ead14eb..b039ffbe68 100644 --- a/alib2data/src/common/symbol_or_epsilon.hpp +++ b/alib2data/src/common/symbol_or_epsilon.hpp @@ -34,8 +34,7 @@ public: explicit symbol_or_epsilon ( SymbolType symbol ) : m_symbol ( std::move ( symbol ) ) { } - explicit symbol_or_epsilon ( ) { - } + explicit symbol_or_epsilon ( ) = default; /** * @return name of the symbol diff --git a/alib2data/src/label/FailStateLabel.cpp b/alib2data/src/label/FailStateLabel.cpp index 41c99ba328..f01c6f4cc6 100644 --- a/alib2data/src/label/FailStateLabel.cpp +++ b/alib2data/src/label/FailStateLabel.cpp @@ -13,9 +13,7 @@ namespace label { -FailStateLabel::FailStateLabel() { - -} +FailStateLabel::FailStateLabel() = default; int FailStateLabel::compare(const FailStateLabel&) const { return 0; diff --git a/alib2data/src/label/FinalStateLabel.cpp b/alib2data/src/label/FinalStateLabel.cpp index 08053234d5..683b8592f2 100644 --- a/alib2data/src/label/FinalStateLabel.cpp +++ b/alib2data/src/label/FinalStateLabel.cpp @@ -13,8 +13,7 @@ namespace label { -FinalStateLabel::FinalStateLabel() { -} +FinalStateLabel::FinalStateLabel() = default; int FinalStateLabel::compare(const FinalStateLabel&) const { return 0; diff --git a/alib2data/src/label/InitialStateLabel.cpp b/alib2data/src/label/InitialStateLabel.cpp index 96e6390cd3..ed9fe64a19 100644 --- a/alib2data/src/label/InitialStateLabel.cpp +++ b/alib2data/src/label/InitialStateLabel.cpp @@ -13,9 +13,7 @@ namespace label { -InitialStateLabel::InitialStateLabel() { - -} +InitialStateLabel::InitialStateLabel() = default; int InitialStateLabel::compare(const InitialStateLabel&) const { return 0; diff --git a/alib2graph_data/src/edge/EdgeBase.hpp b/alib2graph_data/src/edge/EdgeBase.hpp index 0ac4c1fa69..358000e3cf 100644 --- a/alib2graph_data/src/edge/EdgeBase.hpp +++ b/alib2graph_data/src/edge/EdgeBase.hpp @@ -19,8 +19,7 @@ namespace edge { */ class EdgeBase : public ext::CompareOperators < EdgeBase > { public: - virtual ~EdgeBase ( ) noexcept { - } + virtual ~EdgeBase ( ) noexcept = default; /** * \brief Comparison helper method evaluating allowing possibly deeper comparison of this with other class of the same type. diff --git a/alib2graph_data/src/graph/GraphBase.hpp b/alib2graph_data/src/graph/GraphBase.hpp index 5412aa6f04..924ca8551c 100644 --- a/alib2graph_data/src/graph/GraphBase.hpp +++ b/alib2graph_data/src/graph/GraphBase.hpp @@ -19,8 +19,7 @@ namespace graph { */ class GraphBase : public ext::CompareOperators < GraphBase > { public: - virtual ~GraphBase ( ) noexcept { - } + virtual ~GraphBase ( ) noexcept = default; /** * \brief Comparison helper method evaluating allowing possibly deeper comparison of this with other class of the same type. diff --git a/alib2graph_data/src/grid/GridBase.hpp b/alib2graph_data/src/grid/GridBase.hpp index eb51852a26..87be28850e 100644 --- a/alib2graph_data/src/grid/GridBase.hpp +++ b/alib2graph_data/src/grid/GridBase.hpp @@ -19,8 +19,7 @@ namespace grid { */ class GridBase : public ext::CompareOperators < GridBase > { public: - virtual ~GridBase ( ) noexcept { - } + virtual ~GridBase ( ) noexcept = default; /** * \brief Comparison helper method evaluating allowing possibly deeper comparison of this with other class of the same type. diff --git a/alib2graph_data/src/node/NodeBase.hpp b/alib2graph_data/src/node/NodeBase.hpp index 30e53eb192..cdf377cc6e 100644 --- a/alib2graph_data/src/node/NodeBase.hpp +++ b/alib2graph_data/src/node/NodeBase.hpp @@ -19,8 +19,7 @@ namespace node { */ class NodeBase : public ext::CompareOperators < NodeBase > { public: - virtual ~NodeBase ( ) noexcept { - } + virtual ~NodeBase ( ) noexcept = default; /** * \brief Comparison helper method evaluating allowing possibly deeper comparison of this with other class of the same type. diff --git a/alib2gui/src/MainWindow.cpp b/alib2gui/src/MainWindow.cpp index 3ee58e6202..e59a9906a1 100644 --- a/alib2gui/src/MainWindow.cpp +++ b/alib2gui/src/MainWindow.cpp @@ -47,9 +47,7 @@ MainWindow::MainWindow() this->clearScene(); } -MainWindow::~MainWindow ( ) { - -} +MainWindow::~MainWindow ( ) = default; void MainWindow::displayError(const QString& text) const { QMessageBox::critical(ui->graphicsView, "Error", text, QMessageBox::Close); diff --git a/alib2measure/src/allocator/StealthAllocator.hpp b/alib2measure/src/allocator/StealthAllocator.hpp index 9926f10392..fdd841a01c 100644 --- a/alib2measure/src/allocator/StealthAllocator.hpp +++ b/alib2measure/src/allocator/StealthAllocator.hpp @@ -25,7 +25,7 @@ public: template < typename U > struct rebind { using other = stealth_allocator < U >; }; - stealth_allocator ( ) { } + stealth_allocator ( ) = default; template < typename U > stealth_allocator ( const stealth_allocator < U > & ) { } diff --git a/alib2measure/src/measurements/MeasurementResults.cpp b/alib2measure/src/measurements/MeasurementResults.cpp index a0db2a8686..a8fdbe0d7d 100644 --- a/alib2measure/src/measurements/MeasurementResults.cpp +++ b/alib2measure/src/measurements/MeasurementResults.cpp @@ -5,8 +5,7 @@ namespace measurements { -MeasurementResults::MeasurementResults ( ) { -} +MeasurementResults::MeasurementResults ( ) = default; MeasurementResults::MeasurementResults ( const measurements::stealth_vector < MeasurementFrame > & resultFrames ) : frames ( resultFrames ) { } diff --git a/alib2raw/src/registry/RawReaderRegistry.hpp b/alib2raw/src/registry/RawReaderRegistry.hpp index a2c93daf5b..0ed8b66b59 100644 --- a/alib2raw/src/registry/RawReaderRegistry.hpp +++ b/alib2raw/src/registry/RawReaderRegistry.hpp @@ -24,8 +24,7 @@ public: public: virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const = 0; - virtual ~Entry ( ) { - } + virtual ~Entry ( ) = default; }; private: @@ -34,8 +33,7 @@ private: public: std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const override; - virtual ~EntryImpl ( ) { - } + virtual ~EntryImpl ( ) = default; }; static ext::map < std::string, std::unique_ptr < Entry > > & getEntries ( ); diff --git a/alib2raw/src/registry/RawWriterRegistry.hpp b/alib2raw/src/registry/RawWriterRegistry.hpp index d71c0d32d4..3817d7e2c3 100644 --- a/alib2raw/src/registry/RawWriterRegistry.hpp +++ b/alib2raw/src/registry/RawWriterRegistry.hpp @@ -24,19 +24,16 @@ public: public: virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const = 0; - virtual ~Entry ( ) { - } + virtual ~Entry ( ) = default; }; private: template < class Param > class EntryImpl : public Entry { public: - EntryImpl ( ) { - } + EntryImpl ( ) = default; - virtual ~EntryImpl ( ) { - } + virtual ~EntryImpl ( ) = default; std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const override; }; diff --git a/alib2std/src/extensions/container/tree.hpp b/alib2std/src/extensions/container/tree.hpp index d4ccf1ed4c..a09ed12150 100644 --- a/alib2std/src/extensions/container/tree.hpp +++ b/alib2std/src/extensions/container/tree.hpp @@ -783,8 +783,7 @@ public: * \brief * Dectructor of the tree */ - ~tree ( ) noexcept { - } + ~tree ( ) noexcept = default; /** * \brief diff --git a/alib2std/src/extensions/container/tree_base.hpp b/alib2std/src/extensions/container/tree_base.hpp index 786ffdcc83..d56abd14ad 100644 --- a/alib2std/src/extensions/container/tree_base.hpp +++ b/alib2std/src/extensions/container/tree_base.hpp @@ -74,8 +74,7 @@ public: * \brief * Destructor of the tree hierarchy base class. */ - virtual ~BaseNode ( ) noexcept { - } + virtual ~BaseNode ( ) noexcept = default; /** * \brief @@ -169,8 +168,7 @@ public: * \brief * Destructor of the class. */ - virtual ~AnyaryNode ( ) noexcept { - } + virtual ~AnyaryNode ( ) noexcept = default; /** * \brief @@ -755,8 +753,7 @@ public: * \brief * Destructor of the class. */ - virtual ~FixedaryNode ( ) noexcept { - } + virtual ~FixedaryNode ( ) noexcept = default; /** * \brief @@ -981,8 +978,7 @@ public: * \brief * Default constructor. Sets the vector of children to empty vector. */ - VararyNode ( ) { - } + VararyNode ( ) = default; /** * \brief @@ -999,8 +995,7 @@ public: * \brief * Destructor of the class. */ - virtual ~VararyNode ( ) noexcept { - } + virtual ~VararyNode ( ) noexcept = default; /** * \brief diff --git a/alib2std/src/extensions/container/trie.hpp b/alib2std/src/extensions/container/trie.hpp index 0e03be46ba..05ff959ddc 100644 --- a/alib2std/src/extensions/container/trie.hpp +++ b/alib2std/src/extensions/container/trie.hpp @@ -251,8 +251,7 @@ public: * \brief * Dectructor of the trie */ - ~trie ( ) noexcept { - } + ~trie ( ) noexcept = default; /** * \brief diff --git a/alib2std/src/extensions/fdstream.cpp b/alib2std/src/extensions/fdstream.cpp index 0c948b1d79..26b4b293db 100644 --- a/alib2std/src/extensions/fdstream.cpp +++ b/alib2std/src/extensions/fdstream.cpp @@ -109,8 +109,7 @@ ofdstream::ofdstream ( int fd, int fallback_fd ) : /* NOTE: this might potential setstate ( ios_base::failbit ); } -ofdstream::~ofdstream ( ) { -} +ofdstream::~ofdstream ( ) = default; bool ofdstream::is_redirected ( ) const { return fda.is_redirected ( ); @@ -121,8 +120,7 @@ ifdstream::ifdstream ( int fd, int fallback_fd ) : /* NOTE: this might potential setstate ( ios_base::failbit ); } -ifdstream::~ifdstream ( ) { -} +ifdstream::~ifdstream ( ) = default; bool ifdstream::is_redirected ( ) const { return fda.is_redirected ( ); diff --git a/alib2std/src/extensions/range.hpp b/alib2std/src/extensions/range.hpp index 0358089bf8..2d1d2a4f23 100644 --- a/alib2std/src/extensions/range.hpp +++ b/alib2std/src/extensions/range.hpp @@ -67,8 +67,7 @@ public: * \brief * Constructor of empty iterator_range. Both iterators are initialized to default (same) value. */ - iterator_range ( ) { - } + iterator_range ( ) = default; /** * \brief diff --git a/alib2str/src/core/stringApi.hpp b/alib2str/src/core/stringApi.hpp index c898a4e6f4..f39d14dc5b 100644 --- a/alib2str/src/core/stringApi.hpp +++ b/alib2str/src/core/stringApi.hpp @@ -35,8 +35,7 @@ public: public: virtual object::Object parse ( std::istream & input ) = 0; - virtual ~GroupReader ( ) { - } + virtual ~GroupReader ( ) = default; }; private: @@ -57,8 +56,7 @@ public: public: virtual void compose ( std::ostream & output, const object::Object & group ) = 0; - virtual ~GroupWriter ( ) { - } + virtual ~GroupWriter ( ) = default; }; private: diff --git a/alib2str/src/registry/StringReaderRegistry.hpp b/alib2str/src/registry/StringReaderRegistry.hpp index 027b94f55a..2c2e3f32ff 100644 --- a/alib2str/src/registry/StringReaderRegistry.hpp +++ b/alib2str/src/registry/StringReaderRegistry.hpp @@ -25,19 +25,16 @@ public: public: virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const = 0; - virtual ~Entry ( ) { - } + virtual ~Entry ( ) = default; }; private: template < class Return > class EntryImpl : public Entry { public: - EntryImpl ( ) { - } + EntryImpl ( ) = default; - virtual ~EntryImpl ( ) { - } + virtual ~EntryImpl ( ) = default; std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const override; }; diff --git a/alib2str/src/registry/StringWriterRegistry.hpp b/alib2str/src/registry/StringWriterRegistry.hpp index c575b641bc..1d52106e5c 100644 --- a/alib2str/src/registry/StringWriterRegistry.hpp +++ b/alib2str/src/registry/StringWriterRegistry.hpp @@ -24,8 +24,7 @@ public: public: virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const = 0; - virtual ~Entry ( ) { - } + virtual ~Entry ( ) = default; }; @@ -33,11 +32,9 @@ private: template < class Param > class EntryImpl : public Entry { public: - EntryImpl ( ) { - } + EntryImpl ( ) = default; - virtual ~EntryImpl ( ) { - } + virtual ~EntryImpl ( ) = default; std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const override; }; diff --git a/alib2xml/src/registry/XmlComposerRegistry.hpp b/alib2xml/src/registry/XmlComposerRegistry.hpp index 070498eb3b..865b055575 100644 --- a/alib2xml/src/registry/XmlComposerRegistry.hpp +++ b/alib2xml/src/registry/XmlComposerRegistry.hpp @@ -25,19 +25,16 @@ public: public: virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const = 0; - virtual ~Entry ( ) { - } + virtual ~Entry ( ) = default; }; private: template < class Param > class EntryImpl : public Entry { public: - EntryImpl ( ) { - } + EntryImpl ( ) = default; - virtual ~EntryImpl ( ) { - } + virtual ~EntryImpl ( ) = default; std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const override; }; diff --git a/alib2xml/src/registry/XmlContainerParserRegistry.hpp b/alib2xml/src/registry/XmlContainerParserRegistry.hpp index ea65d53e79..6104009a91 100644 --- a/alib2xml/src/registry/XmlContainerParserRegistry.hpp +++ b/alib2xml/src/registry/XmlContainerParserRegistry.hpp @@ -27,8 +27,7 @@ public: public: virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const = 0; - virtual ~Entry ( ) { - } + virtual ~Entry ( ) = default; }; private: @@ -37,8 +36,7 @@ private: public: std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const override; - virtual ~SetEntryImpl ( ) { - } + virtual ~SetEntryImpl ( ) = default; }; static ext::map < std::string, ext::list < ext::pair < std::string, std::unique_ptr < Entry > > > > & getEntries ( ); diff --git a/alib2xml/src/registry/XmlParserRegistry.hpp b/alib2xml/src/registry/XmlParserRegistry.hpp index e9ad573482..60c8a82cf2 100644 --- a/alib2xml/src/registry/XmlParserRegistry.hpp +++ b/alib2xml/src/registry/XmlParserRegistry.hpp @@ -24,19 +24,16 @@ public: public: virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const = 0; - virtual ~Entry ( ) { - } + virtual ~Entry ( ) = default; }; private: template < class Return > class EntryImpl : public Entry { public: - EntryImpl ( ) { - } + EntryImpl ( ) = default; - virtual ~EntryImpl ( ) { - } + virtual ~EntryImpl ( ) = default; std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const override; }; -- GitLab