Versioned std.exception.bailOut()?

Jonathan M Davis jmdavisProg at gmx.com
Fri Jun 15 09:37:20 PDT 2012


On Friday, June 15, 2012 15:50:17 Jacob Carlborg wrote:
> On 2012-06-15 14:55, Kagamin wrote:
> > On Friday, 15 June 2012 at 12:17:32 UTC, bearophile wrote:
> >> Even if this version is not documented in Phobos docs (because the
> >> inliner someday will be better), today it allows methods that must be
> >> fast like Nullable.get() to be inlined (but I have not tested this),
> >> regaining the lost performance.
> > 
> > And how the assert helps with inlining?
> 
> Perhaps throwing an exception prevents inlining ?

It's the fact that enforce is lazy which prevents inlining (which really does 
need to be fixed or enforce is going to continue to be a performance problem).

However, this suggestion is clearly bad, because it's suggesting turning an 
exception into an assertion, which is _very_ broken thing to do. Assertions 
and exceptions are two _very_ different things and should be treated as such.

- Jonathan M Davis


More information about the Digitalmars-d mailing list