Boost logo

Boost Users :

From: Soren Dreijer (admin_at_[hidden])
Date: 2008-01-13 12:11:11


I'm creating a posix_time::time_duration object based on the minutes()
helper function. If I specify a large value, such as 2000, I get a
time_duration of 33:20:00. Take a look at the following piece of code,
though:

time_duration td = minutes(2000);
cout << to_simple_string(td); // OK
cout << td; // Fails with an assertion in VS2008

The latter call fails with the following assertion in strftime.c on line
658:
_VALIDATE_RETURN( ( ( timeptr->tm_hour >=0 ) && ( timeptr->tm_hour <=
23 ) ), EINVAL, FALSE)

Apparently, operator<< expands to _expandtime(), which doesn't allow values
for the hour to be greater than 23. Is this intended behavior, or should I
just always use to_simple_string() rather than the convenient operator<< ?


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net