Menu

#305 ‘auto_ptr’ is deprecated - g++-4.7 - C++11

v1.1.x
wont-fix
5
2015-10-29
2014-06-04
No

warning: ‘auto_ptr’ is deprecated (declared at /usr/include/c++/4.7/backward/auto_ptr.h:87) [-Wdeprecated-declarations]

Are you planning to replace auto_ptr entries?

Many thanks in advance!
Best regards,
Csaba

Discussion

  • Václav Haisman

    Václav Haisman - 2014-06-05

    These are replaced on master branch only, because master is C++11 based. Existing branches have to stay compatible with C++03 and thus it cannot be replaced.

     
  • Alexis Wilke

    Alexis Wilke - 2015-05-28

    Don't we have unique_ptr<> in C++03?

     
    • Václav Haisman

      Václav Haisman - 2015-05-28

      Nope. unique_ptr<> is not part of that standard. There is one in Boost but log4cplus' philosophy is not to depend on such huge dependency for core functionality.

       
  • Alexis Wilke

    Alexis Wilke - 2015-10-28

    Maybe one way would be to use a #define to redefine auto_ptr as unique_ptr if the version of C++ in use is high enough. I don't like macros, but this was just a though.

    // pseudo code
    #if GCC_VERSION >= x.y.z
    #define auto_ptr unique_ptr
    #endif
    
     
    • Václav Haisman

      Václav Haisman - 2015-10-29

      I tried to do something similar but IIRC there was a subtle issue in semantics. It is not 1:1 replacement. The master branch already uses only unique_ptr<>.

       
  • Václav Haisman

    Václav Haisman - 2015-10-29
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,3 @@
    -
     warning: ‘auto_ptr’ is deprecated (declared at /usr/include/c++/4.7/backward/auto_ptr.h:87) [-Wdeprecated-declarations]
    
     Are you planning to replace auto_ptr entries?
    
    • status: open --> wont-fix
     

Log in to post a comment.