[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
10.1.2.1 C++ Unions
The %union
directive works as for C, see The Union Declaration. In particular it produces a genuine
union
, which have a few specific features in C++.
- -
The type
YYSTYPE
is defined but its use is discouraged: rather you should refer to the parser’s encapsulated typeyy::parser::semantic_type
. - - Non POD (Plain Old Data) types cannot be used. C++ forbids any instance of classes with constructors in unions: only pointers to such objects are allowed.
Because objects have to be stored via pointers, memory is not
reclaimed automatically: using the %destructor
directive is the
only means to avoid leaks. See section Freeing Discarded Symbols.
This document was generated on December 1, 2013 using texi2html 5.0.