c++ - how to resolve g++ warning with -std=c++11: ‘auto_ptr’ is deprecated -


this question has answer here:

trying out -std=c++11 g++ compiler, got lots of

warning: ‘auto_ptr’ deprecated (declared @  /usr/include/c++/4.8/backward/auto_ptr.h:87) [-wdeprecated-declarations] 

what should use instead of auto_ptr? please give informative link or complete answer.

you may use std::unique_ptr instead of std::auto_ptr

and if copied auto_ptr, have std::move unique_ptr.


Comments

Popular posts from this blog

python - Installing PyDev in eclipse is failed -

PHP OOP-based login system -

c# - Nested Internal Class with Readonly Hashtable throws Null ref exception.. on assignment -