[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.15.9 Static fields

Both C++ and Java classes can have static fields. These are allocated statically, and are shared among all instances.

The mangling starts with a prefix (`_' in most systems), which is followed by the mangling of the class name, followed by the "joiner" and finally the field name. The joiner (see JOINER in cp-tree.h) is a special separator character. For historical reasons (and idiosyncracies of assembler syntax) it can `$' or `.' (or even `_' on a few systems). If the joiner is `_' then the prefix is `__static_' instead of just `_'.

For example Foo::Bar::var (or Foo.Bar.var in Java syntax) would be encoded as `_Q23Foo3Bar$var' or `_Q23Foo3Bar.var' (or rarely `__static_Q23Foo3Bar_var').

If the name of a static variable needs Unicode escapes, the Unicode indicator `U' comes before the "joiner". This \u1234Foo::var\u3445 becomes _U8_1234FooU.var_3445.



This document was generated by system on December, 2 2004 using texi2html