On Wednesday, 12 April 2023 at 04:57:58 UTC, Salih Dincer wrote:
I think you want to do an encapsulation like below.```d auto opIndex(string key) => *(key in data); ```
I made a little mistake and I'll fix it before someone rub nose in it :)
```d
auto opIndex(string key) {
if(auto ret = key in data)
{
return *ret;
}
return null;
}
assert(handler["D Lang"] == &foo);
assert(handler["null"] is null);
```
SDB@79
