Indicates that the name or entity declared with this attribute is deprecated, that is, the use is allowed, but discouraged for some reason.
[[deprecated]] | (1) | |
[[deprecated( string-literal )]] | (2) |
| string-literal | - | text that could be used to explain the rationale for deprecation and/or to suggest a replacing entity |
Indicates that the use of the name or entity declared with this attribute is allowed, but discouraged for some reason. Compilers typically issue warnings on such uses. The string-literal, if specified, is usually included in the warnings.
This attribute is allowed in declarations of the following names or entities:
struct [[deprecated]] S;, [[deprecated]] typedef S* PS;, using PS [[deprecated]] = S*;, [[deprecated]] int x;, union U { [[deprecated]] int n; };, [[deprecated]] void f();, namespace [[deprecated]] NS { int x; } enum [[deprecated]] E {};, enum { A [[deprecated]], B [[deprecated]] = 42 };. template<> struct [[deprecated]] X<int> {}; A name declared non-deprecated may be redeclared deprecated. A name declared deprecated cannot be un-deprecated by redeclaring it without this attribute.
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
http://en.cppreference.com/w/cpp/language/attributes/deprecated