Add Timer copy constructor (#932)

- Satisfy the rule of three
This commit is contained in:
Veli-Matti Visuri 2017-08-02 23:34:28 +03:00 committed by Daniel Marjamäki
parent 952c31638c
commit da3846f752
2 changed files with 10 additions and 0 deletions

View File

@ -82,6 +82,15 @@ Timer::Timer(const std::string& str, unsigned int showtimeMode, TimerResultsIntf
_start = std::clock();
}
Timer::Timer(const Timer& other)
: _str(other._str)
, _timerResults(other._timerResults)
, _start(other._start)
, _showtimeMode(other._showtimeMode)
, _stopped(other._stopped)
{
}
Timer::~Timer()
{
Stop();

View File

@ -70,6 +70,7 @@ private:
class CPPCHECKLIB Timer {
public:
Timer(const std::string& str, unsigned int showtimeMode, TimerResultsIntf* timerResults = nullptr);
Timer(const Timer& other);
~Timer();
void Stop();