On Saturday, 31 August 2024 at 22:06:26 UTC, kdevel wrote:
Is that functionally different from

```
void main()
{
    import std.stdio;

    int[string] test = ["hello": 42];

    if (auto p = "hello" in test)
    {
        writeln("hello => ", *p);
    }
}
```

It's essentially the same. I only suggested it because the original question was about alternatives to pointers, and `Nullable` isn't a pointer.

I suppose it goes to show that avoiding language features just for the sake of it ("no pointers", "no templates", "no imports", ...) is unlikely to accomplish anything useful. :)
  • Re: Associative ... Paul Backus via Digitalmars-d-learn
    • Re: Associa... ryuukk_ via Digitalmars-d-learn
      • Re: Ass... ryuukk_ via Digitalmars-d-learn
        • Re:... Lance Bachmeier via Digitalmars-d-learn
          • ... ryuukk_ via Digitalmars-d-learn
          • ... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
        • Re:... Nick Treleaven via Digitalmars-d-learn
          • ... Nick Treleaven via Digitalmars-d-learn
          • ... Nick Treleaven via Digitalmars-d-learn
    • Re: Associa... kdevel via Digitalmars-d-learn
      • Re: Ass... Paul Backus via Digitalmars-d-learn
        • Re:... ryuukk_ via Digitalmars-d-learn
          • ... evilrat via Digitalmars-d-learn

Reply via email to