Do sorted ranges have any special properties?

Michel Fortin michel.fortin at michelf.com
Tue Jul 27 03:57:57 PDT 2010


On 2010-07-27 01:04:28 -0400, Andrei Alexandrescu 
<SeeWebsiteForEmail at erdani.org> said:

> Tomek Sowin'ski wrote:
>> Checking for a member find() sounds good but doesn't have anything 
>> specific to do with the range being sorted. Any range could define its 
>> find() to special-case on its structure.
> 
> And that's not bad I think. If the range feels it has defined enough 
> structure to implement fast find, maybe find should defer to it. I'm 
> unclear about the best strategy here.

That would be like implementing the uniform calling syntax for certain 
functions. I like it, except that it being only for certain functions 
breaks the 'uniform' thing.

-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/



More information about the Digitalmars-d mailing list