www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Should setDifference take a SortedRange?

reply "Jesse Phillips" <Jesse.K.Phillips+D gmail.com> writes:
The documentation states:

"The two ranges are assumed to be sorted by less."

Would it make more sense for this function, and its siblings, to 
take a SortedRange instead. This would be a breaking change as it 
would require people to either sort or assumeSorted before 
calling.

But SortedRange was added for exactly this application (I 
believe).
Feb 06 2014
parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 2/6/14, 9:35 AM, Jesse Phillips wrote:
 The documentation states:

 "The two ranges are assumed to be sorted by less."

 Would it make more sense for this function, and its siblings, to take a
 SortedRange instead. This would be a breaking change as it would require
 people to either sort or assumeSorted before calling.

 But SortedRange was added for exactly this application (I believe).
Yah, it's a historical order artifact. Andrei
Feb 06 2014