John Torjo wrote:
> I've been using date_time, and it's really cool!

Thanks.

> However, I would have a small request:
> For time iterators: we have hours(), minutes(), seconds(), but no days().
> 
> Of course, instead of days(1) we can have hours(24), still I think it's more
> expressive to have days(1).

This 'discontinuity' with time_duration has been pointed out before, but
it really hasn't been a high priority to fix it.


> For instance, if I want to iterate 1 and a half days, I think it's more
> expressive to say:
> 
> time_iterator it( start, days(1) + hours( 12)) instead of:
> 
> time_iterator it( start, hours( 36))

It's pretty easy to add this yourself if you want:

class days : public boost::posix_time::time_duration {
   days(int day_count) :  
      boost::posix_time::time_duration(day_count*24, 0, 0) 
   {}
};

I didn't compile it, but this should work...

> Russell Hind wrote:
> Why not days(1.5) then?  That would be even easier, wouldn't it?

Sure, but then we have to deal with rounding issues.  To me the
compactness of this is not worth the trouble it creates.

Jeff 
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to