Apparently, functions can be overloaded solely distinguished by attributes:
```d
void f(ref int x) pure { x = 1; }
void f(ref int x)      { x = 2; static int s; ++s; }
```

I thought that, maybe, a `pure` context calls the `pure` function and an impure context calls the impure function, but no: Calling `f` leads to an ambiguity error in both contexts. Even if that worked, what about inferred contexts, i.e. templates? In simple cases, they could forward the contexts in which they are called, but you can instantiate a template without calling it.

What am I missing here?

Reply via email to