|
Boost : |
From: Stjepan Rajko (stipe_at_[hidden])
Date: 2008-07-15 13:39:06
On Tue, Jul 15, 2008 at 3:49 AM, Joel de Guzman
<joel_at_[hidden]> wrote:
>
> If we have a /lazy-sequence/ s, that generates the ones for you,
> then you can use that for s:
>
> vector<int, float, double> ones(all_ones);
>
> all_ones is a lazy-sequence. It generates the ones every time
> the iterator is dereferenced.
>
> A nice strategy is to write a function adaptor that creates
> a fusion sequence. Example:
>
> int one() {return 1}
>
> ...
>
> vector<int, float, double> ones(fusion::make_lazy_sequence(&one));
>
> [snip]
>
> How about hacking on the /lazy_sequence/ idea? Thoughts?
>
I *love it*. Attached is something... similar ;-) (I used the
triple.cpp example as a starting point, it was pretty straightforward)
What do you think?
Stjepan
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk