try/catch idiom in std.datetime

Jonathan M Davis jmdavisProg at gmx.com
Mon Nov 18 02:32:18 PST 2013


On Monday, November 18, 2013 21:16:20 Daniel Murphy wrote:
> Yeah.  On the other hand, if we decide assert(0) means 'assume unreachable'
> we can optimize out the try-catch in release mode, among other things.
> 
> try { s } catch { assert(0); } -> s
> if (e) assert(0); else s; -> e; s;
> 
> etc

I was hoping that we could do something like that, since that would fix this 
problem as far as optimizations go. It leaves the slight verbosity of the try-
catch, which is a bit annoying, but I wouldn't consider it all that big a 
deal, as nice as it would be to make it less verbose.

- Jonathan M Davis


More information about the Digitalmars-d mailing list