How about assert?

downs default_357-line at yahoo.de
Mon Apr 28 10:17:11 PDT 2008


BCS wrote:
> downs wrote:
>> Note that if we had trailing delegate syntax, combined with a
>> break/continue convention like we currently have with opApply, as well
>> as return forwarding, foreach wouldn't be necessary and could be moved
>> to a library function :)
>>
>> The result would look something like: foreach([2, 3, 4, 5]) (int x) {
>> writefln(x); }
>>
>> Probably too big a change though, sadly.
>>
>> Also, let's really move assert into an object.d function. There's _no_
>> reason this should be a keyword.
>>
>>  --downs
> 
> assert is removed completely on release. as a function that won't happen.

Replace it with an empty body and make the parameters lazy.

The compiler should optimize it out if you're building with -O -inline, and what's the point of building in release but not -O?

 --downs



More information about the Digitalmars-d mailing list