On Sat, Oct 6, 2012 at 8:16 PM, David Blaikie <[email protected]> wrote:
> On Sat, Oct 6, 2012 at 9:59 AM, Dmitri Gribenko <[email protected]> wrote:
>> -<tr><td><span class="name">smartptr.AutoPtrInit<br>
>> -(C++03)</span><br><br>
>> -auto_ptr should store a pointer to an object obtained via new as allocated
>> -memory will be cleaned using delete
>> +<tr><td><span class="name">smartptr.SmartPtrInit<br>
>> +(C++)</span><br><br>
>> +C++03: auto_ptr should store a pointer to an object obtained via new as 
>> allocated
>> +memory will be cleaned using delete<br>
>> +C++11: unique_ptr and shared_ptr allow
>> +to specify a custom deleter to handle the new[]/delete[] case correctly
>
> unique_ptr actually doesn't need extra work from the user - if you use
> unique_ptr<T[]> instead of unique_ptr<T>, that is.
>
> shared_ptr isn't ideal for holding arrays (doesn't provide operator[]
> for one thing) but, yes, with a custom deleter it can at least do so
> correctly
>
> (& of course with custom deleters both of these can handle completely
> unrelated resource allocation/deallocation strategies)

Thank you!  Corrected in r165365.

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <[email protected]>*/
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to