[Issue 4475] Improving the compiler 'in' associative array can return just a bool

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jan 7 07:22:49 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=4475



--- Comment #7 from Alex Rønne Petersen <xtzgzorex at gmail.com> 2012-01-07 07:22:48 PST ---
If you need to use x multiple times inside the if statement's true branch, you
end up having to declare a variable, e.g.:

if (foo in someAA)
{
    auto x = someAA[foo];
    someFunction(otherStuff, x, x, moreStuff);
}

As opposed to:

if (auto x = foo in someAA)
    someFunction(otherStuff, *x, *x, moreStuff);

I don't see why pointers are so bad. While, yes, D is a high-level language, it
is not C# or Java.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list