On Saturday, 23 August 2014 at 10:29:04 UTC, ketmar via Digitalmars-d-learn wrote:
On Sat, 23 Aug 2014 10:19:58 +0000
nikki via Digitalmars-d-learn <digitalmars-d-learn@puremagic.com> wrote:

don't use '==' to check for nulls. the right way is:

  if (foo is null) {}
  if (bar !is null) {}

'==' transforms to opEquals call (see 'operator overloading') and 'is'
not.

as for 'best practice' question -- it depends of many things. ;-)

A good to know! thanks.
I'd still be interrested to see the idiomatic D version of that function, what would that depend on ?

Reply via email to