assume, assert, enforce, @safe

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Fri Aug 1 23:01:51 PDT 2014


On 08/02/2014 07:56 AM, eles wrote:
> On Friday, 1 August 2014 at 20:22:39 UTC, Tofu Ninja wrote:
>> On Friday, 1 August 2014 at 20:16:29 UTC, eles wrote:
>>
>>> Yes, but is the same for the C apps. There, you have no assertion in
>>> the release build, the release build is optimized (I imagine very few
>>> would use -O0 on it...), then the sefault happens.
>>>
>>
>> In c the assert is just a check, no assume, the Microsoft compiler
>> even has its own __assume separate from assert.
>
> Because the assert is in the library, not in the language. The compiler
> can make only limited use of it.

It's part of the language standard. The compiler can make as much use of 
it as possible while still conforming to the spec.


More information about the Digitalmars-d mailing list