std.algorithm set operations on SortedRanges only?

Jesse Phillips Jesse.K.Phillips+D at gmail.com
Mon Jul 22 18:09:54 PDT 2013


On Monday, 22 July 2013 at 21:22:42 UTC, bearophile wrote:
> Given all that, isn't it good to have the "Set operations" 
> (that actually work on _sorted bags_, so their name is 
> misleading and probably even wrong) of std.algorithm, like 
> std.algorithm.setDifference accept only SortedRanges?
>
> SetDifference!(less, SortedRange1, SortedRange2) 
> setDifference(alias less = "a < b", R1, R2)(1 r1, SortedRange2 
> r2);

I would expect functions that require a sorted range to take a 
SortedRange.


More information about the Digitalmars-d-learn mailing list