Difference between revisions of "cpp/language/attributes/deprecated"
From cppreference.com
< cpp | language | attributes
m (use templates) |
m (notes) |
||
Line 1: | Line 1: | ||
− | {{cpp/attribute/title|deprecated}} | + | {{cpp/attribute/title|deprecated|notes={{mark since c++14}}}} |
{{cpp/attribute/navbar}} | {{cpp/attribute/navbar}} | ||
Revision as of 04:22, 24 June 2018
Template:cpp/attribute/title Template:cpp/attribute/navbar
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 |