[phobos] datetime review (Question about SysTime and immutability)

Jonathan M Davis jmdavisProg at gmx.com
Thu Oct 14 20:44:29 PDT 2010


For those of you who have looked at the code, do any of you have any idea why I 
can't create an immutable SysTime or why a const SysTime can't be assigned to a 
mutable one? I assume that it has something to do with the fact that SysTime 
holds a TimeZone, but it's an immutable TimeZone inside of a Rebindable, so it 
shouldn't be a problem.

If I try and create a postblit constructor (which as far as I can tell, 
shouldn't even be necessary), I get a bunch of errors like this:

unittests.d(355): Error: function datetime.timepoint.SysTime.__cpctor (ref 
SysTime p) is not callable using argument types (const(SysTime)) const


which I assume is this bug: http://d.puremagic.com/issues/show_bug.cgi?id=4867 .
Do I need a postblit constructor to make this work? Or am I doing something else 
wrong? If I need a postblit constructor, I appear to be out of luck for the 
moment.

- Jonathan M Davis


More information about the phobos mailing list