[asterisk-scf-dev] auto_ptr

Kevin P. Fleming kpfleming at digium.com
Tue Nov 30 07:28:37 CST 2010


On 11/30/2010 06:16 AM, Joshua Colp wrote:
> ----- Original Message -----
>> So why are we banishing auto_ptr? I know it's deprecated in C++0x, but
>> given how quickly the C++ standards and compilers change, it should be
>> around for the next 100 years or so.
>
> We currently enable an option in GCC that produces warnings for various problems,
> one of them being the usage of deprecated items. We also enable an option which
> treats warnings as errors so that warnings do not creep into code that gets out there.
>
> Since auto_ptr is marked as deprecated this essentially stops the build.
>
> There's three options:
>
> 1. Update the usage of auto_ptr to the world of C++0x like I have done in my c++0x branch.
>
> 2. Disable warning on usage of deprecated items.
>
> 3. Use boost.

Besides all of that... auto_ptr was deprecated for a reason. It's fairly 
easy to misuse, so I'd rather not see usage of it in our code if it can 
be avoided, since it could lead to others copying that usage and not 
understanding the subtleties of it.

-- 
Kevin P. Fleming
Digium, Inc. | Director of Software Technologies
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
skype: kpfleming | jabber: kfleming at digium.com
Check us out at www.digium.com & www.asterisk.org



More information about the asterisk-scf-dev mailing list