possible date-time documentation bug

Hi, It seems that there is a bug in the date time documentation Documentation says this: " To use the alternate resolution (64 bit microsecond) the variable BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG must be defined in the library users project files (ie Makefile, Jamfile, etc). This macro is not used by the Gregorian system and therefore has no effect when building the library." But in reality, the negation is actualy true. 64bit precision is used when this macro is NOT defined. In addition there is a slight problem with posix_time::microseconds() (and possibly with other similar function as well). Somewhere along the way, parameter is converted to long. This might cause some problems, since the resolution is larger (64bit). For instance time_duration::total_microseconds() returns 64bit integer. If the return value is used to initialize a duration of that lenght, overflow occurs. I'm using current cvs version of boost. Regards, Pavol

On Mon, 22 Nov 2004 15:38:42 +0100, Pavol Droba wrote
Hi,
It seems that there is a bug in the date time documentation
Documentation says this:
" To use the alternate resolution (64 bit microsecond) the variable BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG must be defined in the library users project files (ie Makefile, Jamfile, etc). This macro is not used by the Gregorian system and therefore has no effect when building the library."
But in reality, the negation is actualy true. 64bit precision is used when this macro is NOT defined.
Argh -- you're right, the documentation is backwards.
In addition there is a slight problem with posix_time::microseconds() (and possibly with other similar function as well). Somewhere along the way, parameter is converted to long. This might cause some
Yes, I see. The problem here is that you will not be able to access the full range of a duration using a microsecond count. Just guessing here, but I think this might be fixed by 2 small changes: //date_time/time_duration.hpp template<class base_duration, long frac_of_second> // ^^^^ // change to boost::int64_t class subsecond_duration : public base_duration { public: typedef typename base_duration::traits_type traits_type; explicit subsecond_duration(long ss) : // ^^^^ change this to boost::int64_t Jeff
participants (2)
-
Jeff Garland
-
Pavol Droba