[Iterators] Iterators and higher-order programming

Hi, One of the interesting things about the iterators library, it seems to me, is the additional support it gives for higher-order, functional-style programming. For example, you can use the transform and filter iterators to produce a simple 'Comprehension' object which permits list-comprehension type of syntax to be used, instead of conventional loops (or, e.g., std::transform). I found this quite exciting. I guess I could have come across this nice library sooner if it had been called 'Higher-Order Iterators' or at least co-categorised under the Function Objects and Higher-Order Programming library category. Anyway, is the the intention that we now have a 'computationally-complete' alternative to loops, with which we can write general loops in a more functional, type-ful way? Regards, Tom

Thomas Jordan a écrit :
Hi, One of the interesting things about the iterators library, it seems to me, is the additional support it gives for higher-order, functional-style programming. For example, you can use the transform and filter iterators to produce a simple 'Comprehension' object which permits list-comprehension type of syntax to be used, instead of conventional loops
You might want to look at the range library then, which has been recently modified to add support for things like: some_range | transformed(f) | filtered(p)
participants (2)
-
Mathias Gaunard
-
Thomas Jordan