On Saturday, 31 August 2024 at 13:48:52 UTC, ryuukk_ wrote:
On Saturday, 31 August 2024 at 13:00:42 UTC, Steven Schveighoffer wrote:
On Saturday, 31 August 2024 at 12:47:25 UTC, ryuukk_ wrote:
```D
void main()
{
    int[string] test;

    test["hello"] = 42;

    if (auto it = "hello" in test)
    {

    }

}
```
Is there a way to get the value instead of a pointer? while keeping the conciseness (one line)

Maybe if(auto it = test.get(“hello”, 0))

-Steve

Now i can't use 0 as a value, that's not a solution

Shall the if clause evaluate as true if the value of the AA lookup coerces to false (and vice versa)?
  • Associative Arra... ryuukk_ via Digitalmars-d-learn
    • Re: Associa... Steven Schveighoffer via Digitalmars-d-learn
      • Re: Ass... ryuukk_ via Digitalmars-d-learn
        • Re:... kdevel via Digitalmars-d-learn
    • Re: Associa... Paul Backus via Digitalmars-d-learn
      • Re: Ass... ryuukk_ via Digitalmars-d-learn
        • Re:... ryuukk_ via Digitalmars-d-learn
          • ... Lance Bachmeier via Digitalmars-d-learn
            • ... ryuukk_ via Digitalmars-d-learn
            • ... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
          • ... Nick Treleaven via Digitalmars-d-learn
            • ... Nick Treleaven via Digitalmars-d-learn
            • ... Nick Treleaven via Digitalmars-d-learn
      • Re: Ass... kdevel via Digitalmars-d-learn

Reply via email to