C++ Tips: Type Checking


Table of Contents


Type casting in C versus C++
Casting pointer references is dangerous
Checking types at run-time
Downcasting and run-time type checking scheme
Alternative syntax for object status checks
Object slicing and type-safety
Distinguishing function type signatures
Const objects and caching values
Typedefs are type aliases
Casting to and from void
Static data members of a private type
Casting this versus *this
Casting away const
Casting and lvalues
"Avoiding" downcasts in container classes using unions
Casting to and from void pointers
Example of another downcasting scheme
Run-time type information and messages
Void implicit type conversions
Thoughts on downcasting
Should classes identify themselves?
Reinterpreting implicit int in typedefs
Casting and memory layout
Designing a down-cast facility
Thoughts on RTTI (run-time-type-identification)
Using private nested classes
New cast notations adopted for C++
New cast notations adopted for C++
New cast notation for C++ - reinterpret_cast
New cast notation for C++ - const_cast
Thoughts on dynamic_cast and a mythical "narrow" cast
Casting across multiple base classes
What are descriminated unions?
Assignment of dynamic type (long explaination)
faking downcast till dynamic_cast<> is implemented
downcasting from virtual base
bjarne on rtti
new C++ language casts
why not simply downcast from virtual base
finding the "beginning address" of an object
static_cast and reinterpret_cast
more on static_cast and reinterpret_cast
sideways and double casting
new casting in plain english
one tiny bit of life left for old casts
Casting pointer to member functions
variatic functions, args, and type punning
reinterpret_cast<> and type_punning
old and new style casts
evil downcasting
reinterpret_cast non-omnipotency
notes on type_info
examples of using static cast
appropriate uses of static_cast
a rationale for static_cast
Casting between structs and arrays

This site was grabbed using the TRIAL version of Grab-a-Site. This message does not appear on a licensed copy of Grab-a-Site.