Cpp Coding Standards/TYPE

From Apache OpenOffice Wiki
< Cpp Coding Standards
Revision as of 09:30, 23 May 2007 by Np (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Type Safety (TYPE)

Casts and type recognition.

Types, not Representations (NoRepr)

Rely on types, not on representations. Don't think in bits, don't memcpy non-PODs. -> Details

No switch on Types (NoSwitch)

Don't use switch, when the cases represent types. Prefer polymorphism. -> Details

No C-Style Casts (CCast)

Don't use C-Style casts, but the C++ casts. -> Details

Avoid static_cast on Pointers (StacaPtr)

Use dynamic_cast instead of static_cast when treating pointers polymorphically. -> Details


Related Rules


Personal tools