
Mark Van Dijk wrote:
The following code snippet produces an ASSERT on my machine running WinXP (sp2) with VS8 (sp1) with boost v1.34.1:
boost::posix_time::time_duration t(24, 0, 0); std::cout << t << std::end;
The assertion occurs because there is a check in the underlying CRT that verifies the hours portion is between 0 and 23 inclusive. Is this something that might be fixed in boost 1.35?
Well, I don't know what the problem is, but it isn't that the library restricts you to 24 hours. If you look in test/posix_time/testduration.cpp you'll see this test: time_duration tdl2(2000000, 0, 0, 0); check("2000000 hours", tdl2.hours() == 2000000); among others. And it clearly passes on VC8. So, I think you must have a compilation problem or something else going on. HTH, Jeff