[Issue 12666] @nogc std.array.front, popFront, and more

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Apr 27 12:32:55 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=12666

--- Comment #1 from bearophile_hugs at eml.cc ---
(In reply to bearophile_hugs from comment #0)

>     enum msg = "Attempting to fetch the front of an empty array of " ~
> T.stringof;
>     assert(a.length, msg);

A little shorter code, that requires less changes:

assert(a.length, ctEval!("Attempting to fetch the front of an empty array of "
~ T.stringof));

Where ctEval is a very small construct that should be added to Phobos that
forces the evaluation of an expression at compile-time.

--


More information about the Digitalmars-d-bugs mailing list