Gneric linkedList range adaptor

Ruby The Roobster rubytheroobster at yandex.com
Fri Feb 10 23:52:48 UTC 2023


On Friday, 10 February 2023 at 23:39:11 UTC, Ruby The Roobster 
wrote:

>
> The problem is that Node.next is not, and cannot be `static`.  
> Thus, there is no way for you to pass it as an alias template 
> parameter, and this should be considered a compiler bug that 
> this doesn't error out.

Nevermind, I'm an absolute idiot.  The first works, it uses 
Node.next in the context of this.current.  The second should also 
work, T is of type Node*.

This seems to be a bug with the compiler, it automatically infers 
function attributes by default before evaluating whether the 
function actually works with said inferred attributes.

Your __traits(child) solution doesn't work, because T is a type, 
not a variable.




More information about the Digitalmars-d-learn mailing list