[clang-tidy] Use default to initialize constructors

Found with modernize-use-equals-default

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2019-09-27 19:35:54 -07:00 committed by Paul Beckingham
parent 897759e4dc
commit bf40ea8816
3 changed files with 4 additions and 29 deletions

View file

@ -49,21 +49,10 @@ A2::A2 (const std::string& raw, Lexer::Type lextype)
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
A2::A2 (const A2& other) A2::A2 (const A2& other) = default;
: _lextype (other._lextype)
, _tags (other._tags)
, _attributes (other._attributes)
{
}
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
A2& A2::operator= (const A2& other) A2& A2::operator= (const A2& other) = default;
{
_lextype = other._lextype;
_tags = other._tags;
_attributes = other._attributes;
return *this;
}
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
bool A2::hasTag (const std::string& tag) const bool A2::hasTag (const std::string& tag) const

View file

@ -50,9 +50,7 @@ Lexer::Lexer (const std::string& text)
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
Lexer::~Lexer () Lexer::~Lexer () = default;
{
}
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// When a Lexer object is constructed with a string, this method walks through // When a Lexer object is constructed with a string, this method walks through

View file

@ -166,19 +166,7 @@ const std::string& Variant::source () const
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
Variant& Variant::operator= (const Variant& other) Variant& Variant::operator= (const Variant& other) = default;
{
_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;
}
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
bool Variant::operator&& (const Variant& other) const bool Variant::operator&& (const Variant& other) const