简体   繁体   中英

Resurrecting std::auto_ptr in GCC when compiling with -std=c++17

Is there a macro or compiler flag that would let me keep using auto_ptr in GCC 7/8 with -std=c++17 ? I have easily found the corresponding macro for clang and MSVC, but my Google-fu is not good enough to find the solution for GCC.

I don't want to use -fpermissive (it would let me accidentally do too much stuff I shouldn't be able to do), need something more specific.

PS I'm not using auto_ptr , but I have an important 3rd-party library that does.

Yes, you can compile with -Wno-deprecated-declarations to make GCC (also works with clang) ignore warnings about deprecated classes.

You might want to only use this flag for your third party library as it's still a good warning for code that's under your control.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM