I am trying to add some duration to a time_point in Qt (C++11/MinGW) and I am having trouble:
Initialization (when the program starts):
auto program_start_time = std::chrono::system_clock::now();
auto offline_time = std::chrono::system_clock::now();
...
Some activity goes offline:
offline_mark_time = std::chrono::system_clock::now();
...
When the activity resumes, I need to add the offline time to my start time:
auto now = std::chrono::system_clock::now();
program_start_time += (now - offline_mark_time); // <- Does not seem to work
Even though compilation and executions is ok, the program's behavior is as if I am adding zero.
How do you add or subtract a duration to a time_point?