Note: I saw the question: What is the C++11 equivalent to boost::date_time::not_a_date_time?. There is no rectification. So I want to be more specific about my problem to get an answer.
I have a boost::system_time, that will be cleared occasionally by assigning boost::date_time::not_a_date_time.
class Data
{
boost::system_time dateTime;
void clear(void)
{
dateTime = boost::date_time::not_a_date_time;
}
const boost::system_time &getDateTime() const
{
return dateTime;
}
};
void main()
{
Data obj;
// Some processing of Data obj
if ( obj.getDateTime() >= now )
{
// inform some other module
}
}
Now, is there anything in STL, that can be assigned some value (let's say now()) and cleared to be an invalid value?
Tried creating time_point with empty constructor. It is pointing to Epoch time. I see in some odd scenarios, the time_point will have null value. Is there any way to achieve it (If it is safe)