
23 Jul
2009
23 Jul
'09
10:49 p.m.
Andrei Alexandrescu wrote:
That would limit ranges because there are ranges that are not pairs of iterators.
All ranges can be expressed as pairs of iterators, so I hardly see how that limits anything. The issue is that expressing a range as a pair of iterators may not always be optimal.
You would pass two adjacent ranges, like D's bringToFront (a generalization of STL's rotate, see http://www.digitalmars.com/d/2.0/phobos/std_algorithm.html) takes.
Nice idea, that could work. But how can I generate those two adjacent ranges in the first place at reasonable costs? Do ranges requires to provide a constant time "complement" primitive?