Since C++11, attributes allow compilers to add additional warning/error behaviours for variables, functions/methods, and objects. This can vary greatly from compiler-to-compiler — some are widely supported, but others are specific to a compiler (for example, MSVC has several unique attributes).
Attributes are stored in double square brackets, as followed:
A non-exhaustive list of the important attributes supported by most compilers:
[[nodiscard]]
— tags a function/method/type, and allows the compiler to issue a warning if a return value (from a function/method or any type).