in Visual Studio is it possible to #deprecated a function, based on the signature of the function and not simply the name?
In my case we're in C++ and don't want to deprecate all flavors of the function
int foo(); <-- we want to keep
int foo(int x); <-- we want to deprecate
Just do this:
__declspec(deprecated) void foo(int) {}
And if you want the compiler to generate a specific message when compiling a deprecated function, then do this:
__declspec(deprecated("foo(int) is a deprecated function.")) void foo(int) {}
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