Phobos examples and auto

Jonathan M Davis jmdavisProg at gmx.com
Tue Nov 8 12:24:02 PST 2011


On Tuesday, November 08, 2011 21:09:00 Marco Leise wrote:
> With module boundaries I meant that it could have been that modules work
> only with stuff defined inside of them. I'm really surprised that any time
> or duration type works with all the others. In other words I wouldn't even
> have *tried* to do that and instead rolled my own conversion code. Sorry
> for the ignorance and so on...

If you look at the API, Duration and TickDuration can clearly cast to one 
another and can intermix with binary operators. It does look like it's not as 
clear in std.datetime though that both types of durations work with the time 
point types, since the docs just say duration - not Duration or TickDuration - 
so I should probably make them clearer. But the date/time stuff is quite 
interoperable in general. It was designed to work together. You shouldn't need 
to write any conversion code yourself.

- Jonathan M Davis


More information about the Digitalmars-d mailing list