
26 Jul
2009
26 Jul
'09
10:24 p.m.
AMDG Thorsten Ottosen wrote:
Thorsten Ottosen skrev:
Andrei Alexandrescu skrev:
Thorsten Ottosen wrote:
Ok, but the problem with lazy ranges is that when you compose it with range adaptors, then it greatly limits the adaptors that you can subsequently apply.
Why is that the case?
because some adapters require random aceesss ranges e.g.
rng | stride_view
and some requires bidirectionsal ranges e.g.
rng | reverse_view
And also many later operations are usually more efficient when e.g. random access is preserved.
If only one form of the range adapters is provided, then the lazy form is better, because it is possible to implement the greedy version in terms of the lazy one, but not vice versa. In Christ, Steven Watanabe