Suggestion: "fix" assert(obj)

Kristian Kilpi kjkilpi at gmail.com
Thu Jun 14 13:07:56 PDT 2007


On Thu, 14 Jun 2007 21:14:38 +0300, Walter Bright  
<newshound1 at digitalmars.com> wrote:

> Kristian Kilpi wrote:
>> The problem is that
>>    assert(obj);
>>  does not first check if 'obj' is null.
>
> Yes it does, it's just that the hardware does the check, and gives you a  
>   seg fault exception if it is null.

Heh, well, it would be nicer if the assert would fail instead. ;) I think  
usually that's what programmers expect.



More information about the Digitalmars-d mailing list