Gneric linkedList range adaptor
Steven Schveighoffer
schveiguy at gmail.com
Sat Feb 11 05:02:49 UTC 2023
On 2/10/23 5:10 PM, Ben Jones wrote:
> I'm trying to write a range adaptor for linked list types. The range
> type seems to work OK, but my helper function to deduce the node type
> has a compiler error. My hunch is that `nextField` loses its
> association with T when I'm trying to pass it as a template parameter
> inside the helper method, but I can't use __traits(child) there to fix it.
>
This seems like a bug in the compiler.
I did try simplifying, whereas, instead of `T` being a pointer, I just
used `T*` everywhere, and things got a lot simpler.
But it still fails in the same way.
The fact that explicitly specifying the `T` instead of using IFTI works
suggests for sure that the compiler should accept it.
-Steve
More information about the Digitalmars-d-learn
mailing list