Should usually be used to signal misbehavior when return values are not used. The misbehavior might be:
• Memory leaks, such as not using returned allocated memory.
• Unexpected or non-intuitive behavior such as getting different/unexpected behavior when not using the return value.
• Unnecessary overhead, such as calling something that is a no-op if the return value is not used.
Can be used to avoid warnings by the compiler for not using a name or entity.
Can be used to avoid warnings by the compiler for not having a break statement after a sequence of one or more case labels inside a switch statement.
General Attribute Extensions:
- Attributes can now be used to mark namespaces.
namespace [[deprecated]] DraftAPI {}
- Attributes can now be used to mark enumerators (values of enumeration types).
- For user-defined attributes, which should usually be defined in their own namespace, you can now use a using prefix to avoid the repetition of the attribute namespace for each attribute. That is, instead of:
[[MyLib::WebService, MyLib::RestService, MyLib::doc("html")]] void foo();
you can just write
[[using MyLib: WebService, RestService, doc("html")]] void foo();
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.