
27 Sep
2011
27 Sep
'11
10:57 a.m.
On Tue, Sep 27, 2011 at 4:26 AM, Nathan Ridge <zeratul976@hotmail.com> wrote:
From: Olaf van der Spek Not having size() and others like begin, end, etc, is a serious drawback IMO.
Then why not simply use either shared_ptr<array<T, N>> or shared_ptr<vector<T>>?
Best regards, Robert
shared_ptr<array<T, N>> limits you to cases where you know the size of the array at compile time
shared_ptr<vector<T>> results in two dynamic allocations: one for the vector object itself, and one for its internal array
It'll also initialize the elements (not wanted) and it provides another interface. Olaf