![]() The alignas specifier is a part of the attribute specifier sequence, although it has different syntax. In most other situations, attributes apply to the directly preceding entity. In declarations, attributes may appear both before the whole declaration and directly after the name of the entity that is declared, in which case they are combined. ![]() ![]() (note these two attributes are fictional examples, see below for the standard and some non-standard attributes) ![]() ] could be an attribute that applies to a code block or to a for loop, but not to the type int, etc. Attributes provide the unified standard syntax for implementation-defined language extensions, such as the GNU and IBM language extensions _attribute_((.)), Microsoft extension _declspec(), etc.Īn attribute can be used almost everywhere in the C++ program, and can be applied to almost everything: to types, to variables, to functions, to names, to code blocks, to entire translation units, although each particular attribute is only valid where it is permitted by the implementation: ] could be an attribute that can only be used with an if, and not with a class declaration. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |