On 12/8/2014 12:54 PM, Dicebot wrote:
struct ByLine
{
     scope string front();
     // ...
}

auto byLine(File file)
{
     return ByLine(file);
}

scope /* ref */ string foo(scope /* ref */ string input)
{
     return input[1..$];
}

void main()
{
     auto r = file.byLine.map!foo;
     string s = r.front; // this should not compile
     string s = r.front.dup; // this should compile

     // how foo signature should look like for this to work?
}

front() should return a 'scope ref string'.

Reply via email to