Is there a way of marking methods/classes in C++ as obsolete?
In c# you can write:
[Obsolete("You shouldn't use this method anymore.")]
void foo() {}
I use the GNU toolchain/Eclipse CDT if that matters.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The easiest way is with a
#define DEPRECATED. On GCC, it expands to__attribute__((deprecated)), on Visual C++ it expands to__declspec(deprecated), and on compilers that do not have something silimar it expands to nothing.