
18 Jan
2009
18 Jan
'09
12:52 p.m.
Zachary Turner wrote:
It occured to me that boost is lacking a true lazy list. I feel like this should be possible to implement on most compilers, although I doubt I have the metaprogramming expertise to be able to implement such a data structure myself. But nonetheless I think this would be extremely useful. Lazy lists are basically lists that don't store the actual values of the list, instead they store a -function- that is called each time the next element of the list is requested, and the result of that list is returned.
Such things could easily be done with range adaptors. auto fibo = make_range(0, 1) | append_rec(_1 + _2); This could generate the infinite fibonacci range.