Boost logo

Boost :

From: Alexander Nasonov (alnsn-mycop_at_[hidden])
Date: 2004-04-05 13:04:47


Bruno Martínez Aguerre wrote:

> What do you think of:
>
> vector<int> v;
> repeat(bind(vector<int>::push_back, &v, _1)) , 3, 4, 5;
>
> I like it, being explicit and more general. Is something like this
> already in boost?
>
> Bruno Martínez

I'd prefer to have on-fly container. Something like this:

std::copy( on_fly % 1 % 2 % 3, on_fly_end<int>(), back_inserter<int>(v));

Not as cool as v += 1, 2, 3; but might have some advantages.

-- 
Alexander Nasonov
Independent Developer and Consultant

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk