assert(false) in release == splinter in eye

bearophile bearophileHUGS at lycos.com
Mon Oct 11 17:59:07 PDT 2010


Andrei:

> assert(false) could be in an ideal world replaced by an intrinsic called 
> e.g. halt() that looks and feels like a regular function but is 
> recognized by the compiler. No new keyword would be needed. But I don't 
> think that would mark a significant improvement in the language.

I'd like the halt() intrinsic :-) Its main disadvantages are that you need to import it from the intrinsics core module, that you break a bit more backwards compatibility with D1 (because once halt() is present, then assert(0); must vanish in release mode).

Bye,
bearophile


More information about the Digitalmars-d mailing list