Boost logo

Boost :

From: Howard Hinnant (hinnant_at_[hidden])
Date: 2002-03-08 13:23:07


On Friday, March 8, 2002, at 12:51 PM, Peter Dimov wrote:

> One way to solve it (that I see) is
>
> template<class F> vector::vector(size_type n, F f);
>
> that will allocate memory and use f(this->_Ptr, n) to initialize it.

I believe you can essentially do the same thing with the existing
iterator interface.

template <class InputIterator>
   vector(InputIterator first, InputIterator last,
          const Allocator& = Allocator());

Does your proposal have advantages over this?

-Howard


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