Boost logo

Boost :

From: Yitzhak Sapir (yitzhaks_at_[hidden])
Date: 2002-10-07 09:16:15


> -----Original Message-----
> From: Thorsten Ottosen [mailto:nesotto_at_[hidden]]
> Sent: Monday, October 07, 2002 2:00 PM
> To: boost_at_[hidden]
> Subject: Re: [boost] Re: new initialization lib, any interest?
>
>
>
> ----- Original Message -----
> From: "Dirk Gerrits" <dirk_at_[hidden]>
> > vector<int> primes;
> > set_cont( v ) += 1, 2, 3, 5, 7, 11;
> >
> > isn't 'really' an initialization.
> > The vector gets default constructed
> > first.
> that's right. but the term is used in the more broad sence
> "to set up a
> starting configuration".
>

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>());


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