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. :)
