collect_decl Production

Definition

collect_decl : declspec_list struct identifier = type_exp ;
             | declspec_list struct identifier ;
             | declspec_list union identifier = type_exp ;
             | declspec_list union identifier ;
             | declspec_list exception identifier = type_exp ;
             | declspec_list exception identifier ;

Purpose

A collect_decl declares a collection type, or binds an existing one to a name. This is purely for the sake of naming, though it also allows for the creation of a collection type with additional declaration specifiers.

Semantics

The initializer expression must be a collection type of the same class, or a call_exp to a template evaluating to a compatible collection type.

Exactly one struct or union collect_decl may coexist with exactly one uninitialized collect_decl of the same name that declares the same class of collection. Exceptions may be declared with or without a body. Exceptions without a body are exceptions that have no metadata, and cannot coexist with another exception declaration of the same name.