Boost logo

Boost Users :

Subject: Re: [Boost-users] Scoped_array with constructors?
From: Space Ship Traveller (space.ship.traveller_at_[hidden])
Date: 2009-04-21 17:49:39


Thanks for all the useful replies.

Firstly, yes, I attempted to use scoped_ptr into a std::vector which
didn't work out.

I've taken your advice and used the vector to manage the storage. This
is convenient, but does require a copy construction as far as I can
tell..

Kind regards,
Samuel

> Hi!
>
> Just a question. Why not using std::vector in conjunction with
> reserve and std::fill_n or std::generate_n algorithm? Why do you
> need your object instances to be heap allocated and not simply
> constructed in the vector storage? You might be interested by boost
> assign library to fill vector on the fly, instead of using std
> algorithms.
>
> Regards,
> Ovanes
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net