deprecated and deprecatedreason

suggest change

C++14 introduced a standard way of deprecating functions via attributes. [[deprecated]] can be used to indicate that a function is deprecated. [[deprecated("reason")]] allows adding a specific reason which can be shown by the compiler.

void function(std::unique_ptr<A> &&a);

// A message helps callers update their code.
[[deprecated("Use the unique_ptr overload; this overload will be removed")]]
void function(A& a);

// No message, will result in generic warning if called.
[[deprecated]]
void function(A *a);

This attribute may be applied to:

(ref. c++14 standard draft: 7.6.5 Deprecated attribute)

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents