1 | // time_duration can not be formatted with boost_format for more than 99 hours
|
---|
2 | #include <iostream>
|
---|
3 | #include <boost/format.hpp>
|
---|
4 | #include <boost/date_time/posix_time/posix_time.hpp>
|
---|
5 |
|
---|
6 | int main() {
|
---|
7 | // Output for up to 24 is ok
|
---|
8 | std::cout << boost::format( "%1%" ) % boost::posix_time::time_duration( 23, 59, 59, 9999 ) << std::endl;
|
---|
9 | // This is still working
|
---|
10 | std::cout << boost::format( "%1%" ) % boost::posix_time::time_duration( 99, 59, 59, 9999 ) << std::endl;
|
---|
11 | // Stopped working as of revision https://svn.boost.org/trac/boost/changeset/49874
|
---|
12 | // This asserts with a debug build, in time_facet
|
---|
13 | std::cout << boost::format( "%1%" ) % boost::posix_time::time_duration( 100, 0, 0, 0 ) << std::endl;
|
---|
14 | }
|
---|
15 |
|
---|