C++14 introduced the [[deprecated]] attribute that can be used to mark symbols as deprecated, resulting in a warning from the compiler when the symbol is used.
Additional text can be included with the attribute and will be visible as part of the generated warning.
Compiler Explorer link: https://compiler-explorer.com/z/n87WrYo13
@simontoth It's all going full circle. C++ is slowly turning into Rust!