I'm develoiping a class Timer
that some of its members are of type high_resolution_clock::time_point where time_point
is defined as typedef chrono::time_point<system_clock> time_point;
Question
What is the default value of this object?
I need to be aware of this value from couple of reasons:
- Know if member was initialized
- Implement
Timer::Reset()
function
Background
class Timer
{
void Start() { m_tpStop = high_resolution_clock::now(); }
void Stop() { m_tpStart = high_resolution_clock::now(); }
bool WasStarted() { /* TO-DO */ }
void Reset();
__int64 GetDuration();
high_resolution_clock::time_point m_tpStart;
high_resolution_clock::time_point m_tpStop;
};
So, can I implement Timer::WasStarted
by looking only at member m_tpStart
? I'd like to refrain from adding a boolean member for that purpose.