Commenter Worf remarked, "My one wish is that #warning would be supported."I always find it interesting when people say "I wish that Microsoft would stop following standards," since the #warning directive is nonstandard. The Microsoft C/C++ compiler implements the feature in a method compatible with the standard, namely via a #pragma directive.#pragma message("You really shouldn't be doing that.")If you want to warn people away from deprecated functionality, you can use the #pragma deprecated() directive or the even more convenient (but more standards-troublesome) __declspec(deprecated) declaration specifier. The declaration specifier is much more convenient than the preprocessor directive because you can use it in a macro, and you can attach it to specific overloads of a function. (It's also more standards-troublesome because, while it is still permitted by the standard because it begins with a double-underscore, it is also not required to be ignored by compilers which do not understand it.) Read more: The old new thing
QR:
QR:
0 comments:
Post a Comment