The [[deprecated]]
attribute contributed to the C ++ 14 project (see section 7.6.5 [dcl.attr.deprecated] of the October draft ).
The deprecated
token attribute can be used to indicate names and objects whose use is still permitted, but for some reason is not recommended.
For example, the following foo
function is deprecated:
[[deprecated]] void foo(int);
You can provide a message that describes why the name or object is deprecated:
[[deprecated("Replaced by bar, which has an improved interface")]] void foo(int);
The message must be a string literal.
source share