Do sorted ranges have any special properties?

Jonathan M Davis jmdavisprog at gmail.com
Tue Jul 27 09:55:33 PDT 2010


On Tuesday, July 27, 2010 07:05:11 Andrei Alexandrescu wrote:
> This all raises the question: where should this Sorted(R) in the making
> go? It's a range so it should go in std.range, but it's mostly a
> motivator for algorithms, so it should go in std.algorithm. Tiebreakers?

It's a range, so put it in std.range. It's already likely pretty common to be 
importing both anyway, and std.algorithm has more in it than std.range at this 
point. Sure, it may be used with std.algorithm, but someone may have their own 
functions that they'd want to use it with without std.algorithm.

I suppose that it is a bit borderline as to which module it should go in, but 
I'd argue that since it's a range that isn't associated with any particular 
function (like Find! or Until! or whatnot), it should go in std.range.

- Jonathan M Davis


More information about the Digitalmars-d mailing list