On Thursday, 9 January 2014 at 14:08:02 UTC, Manu wrote:
In order to return the result as a string it would require an allocation. You have to request that allocation (and associated eager evaluation) explicitlyThis works fine:
string x = find("Hello", 'H');
This doesn't:
string y = find(retro("Hello"), 'H');
> Error: cannot implicitly convert expression (find(retro("Hello"), 'H'))
of type Result!() to string
string y = "Hello".retro.find('H').to!string;
However, I think to get the expected result from unicode you need
string y = "Hello".byGrapheme.retro.find('H').to!string;
but I might be wrong.