Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Coding literal descriptors

Literal descriptors must be defined in their own C++ statement and the resulting constant used wherever it is required. They cannot be embedded in expressions because they do not create temporary objects.

Literal objects can be declared safely in header files:

Literals can be defined at file-scope, including in header files, in which case they are visible to any code that follows. They can also be declared local to the function which uses them. However, there are a couple of caveats with defining them at function scope:

Thus, if the descriptor is short or used only in an inline function, it is better to define it at file scope with a suitably distinct name.