Fix Timer Variadic Template Implementation

This commit is contained in:
2019-02-09 13:31:22 +01:00
parent b623ba5003
commit fcd4b337c5
5 changed files with 114 additions and 16 deletions
+20
View File
@@ -17,11 +17,31 @@ Timer::~Timer()
Wait();
}
Timer::Timer(Timer&& other) :
m_run(static_cast<bool>(other.m_run)),
m_identifier(other.m_identifier),
m_thread(std::move(other.m_thread))
{
}
Timer& Timer::operator=(Timer&& other)
{
m_run = static_cast<bool>(other.m_run);
m_identifier = std::move(other.m_identifier);
m_thread = std::move(other.m_thread);
return *this;
}
bool Timer::operator==(const Timer& other) const
{
return m_identifier == other.Identifier();
}
bool Timer::operator==(const std::string& identifier) const
{
return m_identifier == identifier;
}
std::string Timer::Identifier() const
{
return m_identifier;