template recursion

Steven Schveighoffer schveiguy at yahoo.com
Tue Jun 26 20:47:27 UTC 2018


On 6/26/18 6:01 AM, ag0aep6g wrote:

> On line 23, you're apparently trying to call std.range.put (which would 
> in turn call tarr[t].put). But being in a method that is itself called 
> "put", that line is instead interpreted as a recursive call (which 
> fails). To refer to std.range.put, you have to prepend a dot (the 
> "module scope operator"):
> 
>      .put(tarr[t], t); // line 23
> 
> https://dlang.org/spec/module.html#module_scope_operators

Naming the hook for `put` the same thing as the global function was one 
of the biggest mistakes in the range library. I almost think we would be 
better off to deprecate that and pick another hook name.

-Steve


More information about the Digitalmars-d-learn mailing list