I made std.time for Phobos, please review my code.

SHOO zan77137 at nifty.com
Tue Apr 27 10:26:25 PDT 2010


Michel Fortin さんは書きました:
> On 2010-04-27 04:55:28 -0400, SHOO <zan77137 at nifty.com> said:
> 
>> By these reasons, I made std.time module as the first step of the
>> contribution for Phobos.
> 
> Looks nice. I think defining structs as you did to handle date and time 
> is the way to go.
> 
> I've done something similar in the past to store dates and times which I 
> like a lot. What I did was just a storage format, but templates allowed 
> me to store dates and time spans with any precision while exposing 
> always the same public API.
> 
> I'm pasting my code below in case it can inspire you (note that this 
> code predates the new operator overloading syntax), and feel free to use 
> any of this under the Boost license if applicable.

In the code that I wrote, it can express Time until December 31, 9999. 
And, the precision of Span is 100 nanoseconds order.
About the precision, I think that it is necessary and sufficient condition.
But your idea is interesting. It seem to be more interesting if BigInt 
is combined.


More information about the Digitalmars-d-announce mailing list