How to mark a method as Obsolete/Deprecated

11 03 2013

Generally we write functions and after sometime we may need to release another version of same code and somehow want to inform clients that previous version should no longer be supported. Yes, we are discussing about deprecating a method or a class in our program.

The deprecated pragma lets you indicate that a function, type, or any other identifier may no longer be supported in a future release or should no longer be used.

__declspec(deprecated("This method is OBSOLETE. Please use the Fun(BOOL) method instead of."))
void Fun();

void Fun(BOOL)

When the compiler encounters a deprecated symbol, it issues C4995.




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: