From 3cafb5257e54a71211beb7cfb02799b5d575157e Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 28 Feb 2021 18:58:44 -0800 Subject: [PATCH] clang-tidy: use = default Found with modernize-use-equals-default Signed-off-by: Rosen Penev --- src/CLI2.cpp | 15 ++------------- src/Lexer.cpp | 5 ----- src/Lexer.h | 2 +- src/Variant.cpp | 14 +------------- src/columns/Column.cpp | 5 ----- src/columns/Column.h | 2 +- src/commands/CmdBurndown.cpp | 7 +------ src/commands/Command.cpp | 5 ----- src/commands/Command.h | 2 +- 9 files changed, 7 insertions(+), 50 deletions(-) diff --git a/src/CLI2.cpp b/src/CLI2.cpp index 4696c3d44..53d8366e2 100644 --- a/src/CLI2.cpp +++ b/src/CLI2.cpp @@ -49,21 +49,10 @@ A2::A2 (const std::string& raw, Lexer::Type lextype) } //////////////////////////////////////////////////////////////////////////////// -A2::A2 (const A2& other) -: _lextype (other._lextype) -, _tags (other._tags) -, _attributes (other._attributes) -{ -} +A2::A2 (const A2& other) = default; //////////////////////////////////////////////////////////////////////////////// -A2& A2::operator= (const A2& other) -{ - _lextype = other._lextype; - _tags = other._tags; - _attributes = other._attributes; - return *this; -} +A2& A2::operator= (const A2& other) = default; //////////////////////////////////////////////////////////////////////////////// bool A2::hasTag (const std::string& tag) const diff --git a/src/Lexer.cpp b/src/Lexer.cpp index df9522d7c..621d9efd8 100644 --- a/src/Lexer.cpp +++ b/src/Lexer.cpp @@ -49,11 +49,6 @@ Lexer::Lexer (const std::string& text) { } -//////////////////////////////////////////////////////////////////////////////// -Lexer::~Lexer () -{ -} - //////////////////////////////////////////////////////////////////////////////// // When a Lexer object is constructed with a string, this method walks through // the stream of low-level tokens. diff --git a/src/Lexer.h b/src/Lexer.h index b861f6886..269926a61 100644 --- a/src/Lexer.h +++ b/src/Lexer.h @@ -54,7 +54,7 @@ public: date, duration }; Lexer (const std::string&); - ~Lexer (); + ~Lexer () = default; bool token (std::string&, Lexer::Type&); static std::vector split (const std::string&); static std::string typeToString (Lexer::Type); diff --git a/src/Variant.cpp b/src/Variant.cpp index c37cd904a..08dbb17aa 100644 --- a/src/Variant.cpp +++ b/src/Variant.cpp @@ -166,19 +166,7 @@ const std::string& Variant::source () const } //////////////////////////////////////////////////////////////////////////////// -Variant& Variant::operator= (const Variant& other) -{ - _type = other._type; - _bool = other._bool; - _integer = other._integer; - _real = other._real; - _string = other._string; - _date = other._date; - _duration = other._duration; - _source = other._source; - - return *this; -} +Variant& Variant::operator= (const Variant& other) = default; //////////////////////////////////////////////////////////////////////////////// bool Variant::operator&& (const Variant& other) const diff --git a/src/columns/Column.cpp b/src/columns/Column.cpp index 9d19c919e..6dfecf58f 100644 --- a/src/columns/Column.cpp +++ b/src/columns/Column.cpp @@ -238,11 +238,6 @@ Column::Column () { } -//////////////////////////////////////////////////////////////////////////////// -Column::~Column () -{ -} - //////////////////////////////////////////////////////////////////////////////// void Column::renderHeader ( std::vector & lines, diff --git a/src/columns/Column.h b/src/columns/Column.h index 15c55dabf..bd96ab339 100644 --- a/src/columns/Column.h +++ b/src/columns/Column.h @@ -41,7 +41,7 @@ public: static Column* uda (const std::string&); Column (); - virtual ~Column (); + virtual ~Column () = default; const std::string& name () const { return _name; } const std::string& style () const { return _style; } diff --git a/src/commands/CmdBurndown.cpp b/src/commands/CmdBurndown.cpp index b02bb2522..dedf25d03 100644 --- a/src/commands/CmdBurndown.cpp +++ b/src/commands/CmdBurndown.cpp @@ -124,7 +124,7 @@ public: Chart (char); Chart (const Chart&); // Unimplemented Chart& operator= (const Chart&); // Unimplemented - ~Chart (); + ~Chart () = default; void scan (std::vector &); void scanForPeak (std::vector &); @@ -184,11 +184,6 @@ Chart::Chart (char type) _period = type; } -//////////////////////////////////////////////////////////////////////////////// -Chart::~Chart () -{ -} - //////////////////////////////////////////////////////////////////////////////// // Scan all tasks, quantize the dates by day, and find the peak pending count // and corresponding epoch. diff --git a/src/commands/Command.cpp b/src/commands/Command.cpp index bf145a0bf..0621bbc7a 100644 --- a/src/commands/Command.cpp +++ b/src/commands/Command.cpp @@ -235,11 +235,6 @@ Command::Command () { } -//////////////////////////////////////////////////////////////////////////////// -Command::~Command () -{ -} - //////////////////////////////////////////////////////////////////////////////// std::string Command::keyword () const { diff --git a/src/commands/Command.h b/src/commands/Command.h index 5d7eb056c..71c13bd30 100644 --- a/src/commands/Command.h +++ b/src/commands/Command.h @@ -53,7 +53,7 @@ public: }; Command (); - virtual ~Command (); + virtual ~Command () = default; static void factory (std::map &);