c++ - how to resolve g++ warning with -std=c++11: ‘auto_ptr’ is deprecated -
this question has answer here:
- std::auto_ptr std::unique_ptr 4 answers
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
Post a Comment