core.intrinsics

Matthias Bentrup via Digitalmars-d digitalmars-d at puremagic.com
Sat Oct 15 03:17:09 PDT 2016


On Friday, 14 October 2016 at 15:42:22 UTC, David Nadlinger wrote:
> On Friday, 14 October 2016 at 13:07:10 UTC, Johan Engelen wrote:
>> On Friday, 14 October 2016 at 12:55:17 UTC, Guillaume Piolat 
>> wrote:
>>> 
>>> - this pointer is aligned to N bytes
>>> - this pointer doesn't alias with this pointer
>>
>> Do you mean these as "just a hint, should not generate invalid 
>> code if not true" or as "a certainty, allowed to generate 
>> invalid code if not true" ?
>
> For alignment/aliasing restrictions to be really beneficial, 
> you have to be able to assume they hold, though. — David

You could turn "hints" that can possibly create invalid code 
automatically into assertions in non-release builds. Or let the 
user add an assertion and use the "turn assert() into assume()" 
idea for release builds.



More information about the Digitalmars-d mailing list