Passing a byLine as an argument to InputRange

Jeff massung at gmail.com
Fri May 14 04:11:39 UTC 2021


On Thursday, 13 May 2021 at 18:29:08 UTC, Ali Çehreli wrote:
> On 5/13/21 10:07 AM, Jeff wrote:
>
> > I have a class where I'd like to supply it with an
> InputRange!string.
> > Yet, for the life of me I can't seem to pass to it a
> File.byLine
>
> As Adam said, your range elements need to be converted to 
> string e.g. with 'text' (the same as to!string). However, you 
> must also create a dynamic InputRange!string object for dynamic 
> polymorphism that InputRange provides. And that's achieved by 
> function inputRangeObject():
>

Thank you all. I'm up and running. ;-)


More information about the Digitalmars-d-learn mailing list