The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Newsgroups: comp.lang.c++.moderated
From: Edward Diener <eldie...@tropicsoft.invalid>
Date: Sat, 14 Apr 2012 23:29:47 -0700 (PDT)
Local: Sun, Apr 15 2012 2:29 am
Subject: Different syntax for shared arrays between unique_ptr and shared_ptr
As I understand it specifying a non-shared array with unique_ptr is
done using the syntax: std::unique_ptr<T[]> up(new T[n]);
The unique_ptr has a partial specialization to handle this.
The syntax for handling shared arrays with shared_ptr is different:
std::shared_ptr<T> sp(new T[n],std::default_delete<T[]>());
Why is the syntax for working with arrays in unique_ptr and shared_ptr
-- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||