Should std.algorithm.find demand a reference to range elements?

Eduardo Pinho via Digitalmars-d digitalmars-d at puremagic.com
Thu Feb 5 03:22:37 PST 2015


On Thursday, 5 February 2015 at 11:11:37 UTC, Jakob Ovrum wrote:
> On Thursday, 5 February 2015 at 11:06:39 UTC, Jakob Ovrum wrote:
>> On Thursday, 5 February 2015 at 11:04:41 UTC, Daniel Murphy 
>> wrote:
>>> "Jakob Ovrum"  wrote in message 
>>> news:flxonctqqtzmtyintbtj at forum.dlang.org...
>>>
>>>> However, this would set a possibly disruptive precedent that 
>>>> range algorithms must no longer use foreach on aggregate 
>>>> types...
>>>
>>> I think this precedent already exists thanks to the bad 
>>> behavior of foreach over narrow strings.
>>
>> Good point.
>>
>> I'll file a PR for `find` in any case.
>
> https://github.com/D-Programming-Language/phobos/pull/2964

I'm glad to see this resolved so quickly! I hope to also see your 
answer in my SO question. Otherwise, I can answer it myself, 
though your words and experience might make a better one.


More information about the Digitalmars-d mailing list