On 10/30/2012 5:53 AM, Don Clugston wrote:
> > I think the code would be
>> better written as:
>>
>>      if (toInt() == 0) throw new Error();
>>
>> If you really must have a divide by zero fault,
>>
>>      if (toInt() == 0) divideByZero();
>>
>> where:
>>
>>      void divideByZero()
>>      {
>>           static int x;
>>           *cast(int*)0 = x / 0;
>>      }
>
> And that works because writes to 0 _are_ considered a side-effect?
> Is that guaranteed to work?

Writing through a pointer is considered a side effect.

Reply via email to