On 05/09/2017 10:34 AM, H. S. Teoh via Digitalmars-d wrote:

> I even appreciate breakages that eventually force me to write more
> readable code!  A not-so-recent example:
>
>    /* Used to work, oh, I forget which version now, but it used to
>     * work: */
>    MyType* ptr = ...;
>    if (someCondition && ptr) { ... }
>
> After upgrading the compiler, I get a warning that using a pointer as a
> condition is deprecated.  At first I was mildly annoyed... but then to
> make the warning go away, I wrote this instead:
>
>    /* Look, ma! Self-documenting, readable code! */
>    MyType* ptr = ...;
>    if (someCondition && ptr !is null) { ... }

Can you show an example please. I don't see this being required by 2.074.0 (compiled with -w -de).

Thank you,
Ali

Reply via email to