Attributes (C++11)
Attributes are a mechanism to add optional and/or vendor-specific information into source code. Before C++11, the vendor decided how to specify that information. Since C++11, there is support for attributes by using the double square brackets syntax [[<attribute>]].
The C++11 standard defines only two standard attributes: [[noreturn]] and [[carries_dependency]]. C++14 adds the [[deprecated]] attribute.
[[noreturn]] means that a function never returns control to the call site. Typically, the function either causes some kind of termination (process termination or thread termination) or throws an exception.
[[deprecated]] can be used to mark something as deprecated, which means you can still use it, but its use is discouraged. This attribute accepts an optional argument that can be used to explain the reason of the deprecation, for example [[deprecated("Unsafe method, please use xyz")]].
Most attributes will be vendor-specific extensions. Vendors are advised not to use attributes to change the meaning of the program, but to use them to help the compiler to optimize code or detect errors in code. Since attributes of different vendors could clash, vendors are recommended to qualify them. For example:
[[clang::noduplicate]]