Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2002-10-07 12:10:33


----- Original Message -----
From: "Yitzhak Sapir" <yitzhaks_at_[hidden]>

>
> Why not make an iterator adaptor (initialization_iterator?) that holds a
list of values with which to initialize. And then pass it to any of the STL
containers. (I can post my implementation if it's interesting):
>
> std::list<int> primes(
> make_init_iterator<int>(2)(3)(5)(7)(11)(),
> make_init_iterator<int>());

I would like to see the code. Anyway, what would the advanteges of this
approach? Wouldn't it be slower because the the iterator adapter needs to
store the values which
are then copied? (I must admit, that speed was not really an initial
concern, I focused on easy use). Another issue is the syntax, with the stuff
above, I don't
thnk any newbie will use it very often.

regards

Thorsten


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