Issue 123960 - Replace uses of auto_ptr with standard compliant smart pointers
Summary: Replace uses of auto_ptr with standard compliant smart pointers
Status: CONFIRMED
Alias: None
Product: General
Classification: Code
Component: code (show other issues)
Version: 4.1.0-dev
Hardware: All All
: P3 Normal (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks: 122766 122208
  Show dependency tree
 
Reported: 2014-01-03 09:23 UTC by hdu@apache.org
Modified: 2014-01-03 09:23 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description hdu@apache.org 2014-01-03 09:23:59 UTC
The auto_ptr template was deprecated in C++11 because it has many well known problems that are solved by tts modern counterpart unique_ptr.

Auto_ptr was also often abused in cases where it shouldn't have been used. The shared_ptr and weak_ptr might be the suitable replacements in these cases. Also if auto_ptr was misemployed to manage arrays then the replacement should get custom deleters to do the delete[] for destructing the array. It's too bad that e.g. boost's shared_array_ptr didn't make it into the C++11 standard.