Versioned std.exception.bailOut()?

Dmitry Olshansky dmitry.olsh at gmail.com
Fri Jun 15 05:21:56 PDT 2012


On 15.06.2012 16:17, bearophile wrote:
>
> What do you think about replacing the bailOut() with:
>
>
> version (halting_enforce)
> {
> private void bailOut(string file, size_t line, in char[] msg) @safe pure
> nothrow
> {
> assert(0, msg ? msg : "Enforcement failed");
> }
> }
> else
> {
> private void bailOut(string file, size_t line, in char[] msg) @safe pure
> {
> throw new Exception(msg ? msg.idup : "Enforcement failed", file, line);
> }
> }

Stupidity. An exemplar one.
Anyone caught trying to hijacking core exception handling primive (that 
by the way check things like file I/O) in std library should be shot on 
sight.


-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list