www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Show AAs in all their virtues

reply "Per =?UTF-8?B?Tm9yZGzDtnci?= <per.nordlow gmail.com> writes:
I believe we should show off D in all its virtue

at http://dlang.org/hash-map.html

by addition to

     int* p = ("hello" in aa);
     if (p !is null) {}

also include the even compacter

     if (auto p = "hello" in aa) {}

along with

     if (const p = "hello" in aa) {}

in the non-mutating case.

Destroy!
Jan 23 2015
parent "aldanor" <i.s.smirnov gmail.com> writes:
On Friday, 23 January 2015 at 16:25:56 UTC, Per Nordlöw wrote:
 I believe we should show off D in all its virtue

 at http://dlang.org/hash-map.html

 by addition to

     int* p = ("hello" in aa);
     if (p !is null) {}

 also include the even compacter

     if (auto p = "hello" in aa) {}

 along with

     if (const p = "hello" in aa) {}

 in the non-mutating case.

 Destroy!
Is this in regards to http://forum.dlang.org/thread/nddqjyjeqihajlhdswkj forum.dlang.org? If so, would you cc your reply in that thread? Thanks.
Jan 23 2015