Subject: Re: [boost] [shared_array] Why not in C++11 ?
From: Glen Fernandes (glen.fernandes_at_[hidden])
Date: 2013-07-08 00:13:19
On Sun, Jul 7, 2013 at 8:27 PM, Andrey Semashev
> ...or even shared_ptr< array<...> >?
One advantage of boost::shared_ptr<T[N]> p1; over shared_ptr<array<T,
N>> p2; is that the former gives you p1[index] which is slightly nicer
than (*p2)[index]. In the case of both, the size N is already known at
compile time anyway since it is part of the type.
> Why not simply use vector or shared_ptr< vector<...> >?
If what he really wants is a std::vector<T>, this is a good
alternative. If not, he pays for a few things you may not use: e.g.
one additional allocation compared to boost::shared_ptr<T>.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk