Difference between revisions of "cpp/language/attributes/deprecated"
From cppreference.com
< cpp | language | attributes
m (Text replace - "cpp/attribute" to "cpp/language/attributes") |
(don't put surrounding context in syntax) |
||
Line 7: | Line 7: | ||
{{sdsc begin}} | {{sdsc begin}} | ||
{{sdsc|num=1|1= | {{sdsc|num=1|1= | ||
− | + | {{ttb|<nowiki>[[</nowiki>deprecated}}{{ttb|<nowiki>]]</nowiki>}} | |
}} | }} | ||
{{sdsc|num=2|1= | {{sdsc|num=2|1= | ||
− | + | {{ttb|<nowiki>[[</nowiki>deprecated(}} {{spar|string-literal}} {{ttb|)<nowiki>]]</nowiki>}} | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
}} | }} | ||
{{sdsc end}} | {{sdsc end}} | ||
− | |||
− | |||
===Explanation=== | ===Explanation=== | ||
Line 41: | Line 18: | ||
This attribute is allowed in declarations of classes, typedef-names, variables, non-static data members, functions, namespaces, enumerations, enumerators, and template specializations. | This attribute is allowed in declarations of classes, typedef-names, variables, non-static data members, functions, namespaces, enumerations, enumerators, and template specializations. | ||
+ | |||
+ | {{todo|illustrate placement here or in the example}} | ||
A name declared non-deprecated may be redeclared deprecated. A name declared deprecated cannot be un-deprecated by redeclaring it without this attribute. | A name declared non-deprecated may be redeclared deprecated. A name declared deprecated cannot be un-deprecated by redeclaring it without this attribute. |
Revision as of 07:57, 24 June 2018
Indicates that the use of the name or entity declared with this attribute is allowed, but discouraged for some reason.
Syntax
[[deprecated ]]
|
(1) | ||||||||
[[deprecated( string-literal )]]
|
(2) | ||||||||
Explanation
Indicates that the use of the name or entity declared with this attribute is allowed, but discouraged for some reason.
This attribute is allowed in declarations of classes, typedef-names, variables, non-static data members, functions, namespaces, enumerations, enumerators, and template specializations.
This section is incomplete Reason: illustrate placement here or in the example |
A name declared non-deprecated may be redeclared deprecated. A name declared deprecated cannot be un-deprecated by redeclaring it without this attribute.
Example
This section is incomplete Reason: no example |