Boost logo

Boost :

From: Jeff Garland (jeff_at_[hidden])
Date: 2004-11-22 10:08:25


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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk