boost pdate is immutable, so how can I use it in a loop? I need to make comparison with last-dealt-with date:
date last(neg_infin);
for (int i = 0; i < tasks.size(); i++) {
if (tasks[i]->getTime().date() > last) {
cout << ":::" << tasks[i]->getTime().date() << ":::" << endl;
}
cout << "[" << i << "]" << '\t';
tasks[i]->print();
// i need to change the last date here
cout << endl;
}
ie. if the date part of current time is later than the previous, print the date, otherwise print only the time
Why do you need an explicit last element? Wont this work as well?