Fix -Wdeprecated-copy warnings (rule of 5/3/0)

Fix -Wdeprecated-copy warnings in various places. Consists in enforcing
rule of five/three/zero (https://en.cppreference.com/w/cpp/language/rule_of_three)
mainly by deleting redundant copy constructors or copy assignment operators
that replicate default constructors/operators, or more rarely by adding
missing copy/move constructors/operators.
See also https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c20-if-you-can-avoid-defining-default-operations-do
This commit is contained in:
howetuft
2019-10-19 20:11:05 +02:00
committed by wmayer
parent 554ae45e27
commit 3e5d3460c7
7 changed files with 76 additions and 49 deletions

View File

@@ -66,7 +66,7 @@ public:
uint64_t getSeconds(void) const;
unsigned short getMiliseconds(void) const;
void operator = (const TimeInfo &time);
//void operator = (const TimeInfo &time);
bool operator == (const TimeInfo &time) const;
bool operator != (const TimeInfo &time) const;
@@ -106,11 +106,11 @@ TimeInfo::operator != (const TimeInfo &time) const
return (timebuffer.time != time.timebuffer.time || timebuffer.millitm != time.timebuffer.millitm);
}
inline void
TimeInfo::operator = (const TimeInfo &time)
{
timebuffer = time.timebuffer;
}
//inline void
//TimeInfo::operator = (const TimeInfo &time)
//{
//timebuffer = time.timebuffer;
//}
inline bool
TimeInfo::operator == (const TimeInfo &time) const