Boost logo

Boost :

From: Eric Niebler (eric_at_[hidden])
Date: 2006-12-12 12:54:17


Jeff Garland wrote:
> Eric Niebler wrote:
>> Jeff Garland wrote:
>> Of
>>> course, what I'm thinking is for the stock price rolling average example above
>>> you might want to use gregorian::date or posix_time::ptime to represent point
>>> of measurement of the stock price. I wasn't finding the requirements for the
>>> offset_type...which is what I think would need to be replaced.
>>
>> Right, I should document the requirements on the offset_type. The code
>> has been tested with offset_types of int and double. I think the right
>> concept for offset_type is LessThanComparible.
>
> Well, here's the thing. In date-time the 'duration_type' and the
> 'point_in_time_type' are different. For example, with dates you have 'date'
> as the 'point_in_time' which is conceptually dimensionless and the
> duration_type 'day'. If you subtract 2 points in time you get a duration. So
> it's possible there would need to be a different type in the mix to make
> things work. Anyway, this will be a good experiment at some point. I'd do it
> myself if I only had more time.... ;-)

Ah. So the type of (offset - offset) is not the same as the type of
offset. That's not a problem in theory, but certainly the code doesn't
handle that situation right now.

Thanks for the feedback.

-- 
Eric Niebler
Boost Consulting
www.boost-consulting.com

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