0

I am working on a project in C++ where I have written a set of new classes which supersedes some other classes with similar functionality. I therefore want to deprecate the old classes and all methods within it. I've found you can do [[deprecated]] or [[deprecated](reason for deprecation)] but this only for C++14. I'm using C++11 but surely deprecating something its a new thing that only the latest C++ versions can do?

Am I missing something or would I have to upgrade my project to be C++14 (assuming I have a compiler that is capable)?

Boardy
  • 35,417
  • 104
  • 256
  • 447
  • Deprecating isn't new, but the attribute is. You might want to look into compiler attributes/pragmas if you want it before C++14. – Passer By Jul 22 '18 at 15:00
  • There are some compiler-dependent solutions. What's your compiler? Also, why not simply use a newer standard? – HolyBlackCat Jul 22 '18 at 15:00
  • I would think in 2018 most compilers that support `C++11` should support `C++14`, so I would check that first. – Galik Jul 22 '18 at 15:00
  • Check your compiler's documentation. Even pre-dating C++11, most compilers have compiler-specific keywords that will result in a warning diagnostic if an attempt is made to reference a deprecated function or class. Since you neglected to specify which compiler you're using, no further help can be given. – Sam Varshavchik Jul 22 '18 at 15:42
  • I use a combo of VS 2017 for Windows and G++ for Linux. I've updated to use C++14 seems to be OK – Boardy Jul 23 '18 at 10:33

0 Answers0