Difference between revisions of "cpp/language/attributes/deprecated"
From cppreference.com
< cpp | language | attributes
m (T. Canens moved page cpp/attribute/deprecated to cpp/language/attributes/deprecated without leaving a redirect: Text replace - "cpp/attribute" to "cpp/language/attributes") |
m (Text replace - "cpp/attribute" to "cpp/language/attributes") |
||
Line 1: | Line 1: | ||
− | {{cpp/ | + | {{cpp/language/attributes/title|deprecated|notes={{mark since c++14}}}} |
− | {{cpp/ | + | {{cpp/language/attributes/navbar}} |
Indicates that the use of the name or entity declared with this attribute is allowed, but discouraged for some reason. | Indicates that the use of the name or entity declared with this attribute is allowed, but discouraged for some reason. |
Revision as of 07:45, 24 June 2018
Indicates that the use of the name or entity declared with this attribute is allowed, but discouraged for some reason.
Syntax
class-key [[deprecated reason(optional)]] class-name ;
|
(1) | ||||||||
class-key [[deprecated reason(optional)]] class-name final(optional) base-clause(optional) { member-specification }
|
(2) | ||||||||
using identifier [[deprecated reason(optional)]] = defining-type-id ;
|
(3) | ||||||||
[[deprecated reason(optional)]] declaration
|
(4) | ||||||||
declarator-id [[deprecated reason(optional)]]
|
(5) | ||||||||
inline (optional) namespace [[deprecated reason(optional)]] name { namespace-body }
|
(6) | ||||||||
enum-key [[deprecated reason(optional)]] enumeration-name enum-base(optional) ;
|
(7) | ||||||||
enum-key [[deprecated reason(optional)]] enumeration-name enum-base(optional) { enumerator-list }
|
(8) | ||||||||
enumerator [[deprecated reason(optional)]]
|
(9) | ||||||||
reason, if present, has the form (
string-literal )
.
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.
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 |