Proposal for custom time string formatting in std.datetime

Jonathan M Davis jmdavisProg at gmx.com
Thu Dec 22 23:12:29 PST 2011


On Thursday, December 22, 2011 21:30:46 Walter Bright wrote:
> On 12/22/2011 7:13 PM, Jonathan M Davis wrote:
> > Okay. Assuming that I'm going to try and make TimeZone opaque within
> > SysTime, does that require a pointer rather than a reference? And I
> > assume then that the time zone stuff would need to be in a separate
> > module than SysTime. That being the case, how would SysTime be able to
> > use the time zone without importing that module? Does the C++ solution
> > of forward declaring it like
> > 
> > class TimeZone;
> > 
> > work in D?
> 
> It'll still put a reference to TimeZone in the ModuleInfo.

Will that still happen if the TimeZone is used in templated functions? SysTime 
has several functions that use TimeZone explicitly - e.g. the timezone 
property. It needs to be able to take and return a TimeZone. However, it 
_could_ be templatized with an empty template parameter list. Would that avoid 
pulling in the information on TimeZone if those functions aren't instantiated? 
Or would it still pull it in?

- Jonathan M Davis


More information about the Digitalmars-d mailing list