2.2 KiB
[dcl.attr.annotation]
9 Declarations [dcl]
9.13 Attributes [dcl.attr]
9.13.12 Annotations [dcl.attr.annotation]
An annotation may be applied to any declaration of a type, type alias, variable, function, namespace, enumerator,base-specifier, or non-static data member.
Let E be the expressionstd::meta::reflect_constant(constant-expression).
E shall be a constant expression; the result of E is the underlying constant of the annotation.
Each annotation produces a unique annotation.
Substituting into an annotation is not in the immediate context.
[Example 1:
void f(); void g();void g ();f has one annotation and g has five annotations.
These can be queried with metafunctions such as std::meta::annotations_of ([meta.reflection.annotation]).
â end example]
[Example 2: template void f(T t);
void f(int);
void g() { f(0); // OK f('0'); // error, substituting into the annotation results in an invalid expression} â end example]