I have a few TypeDefs that I want to deprecate. I am doing this to retain backward compatibility with code that already exists. Is there an elegant (or maybe not so elegant) solution to this? I would like it to be platform independent but if there is a Visual Studio only solution, that will do as well.
In MSVC++, you can deprecate typedef
like this:
typedef __declspec(deprecated) int myint;
The MSVC++ compiler will generate warning that myint
is deprecated!
And if you want the compiler to generate a specific message when compiling a deprecated typedef, then do this:
typedef __declspec(deprecated("myint is deprecated, so most likely in the next version this myint will be missing")) int myint;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With