c++ dynamic typecasts... (just nosy)

Gabriel Dos Reis gdr@codesourcery.com
Mon Feb 26 10:58:00 GMT 2001


Axel Kittenberger <Anshil@gmx.net> writes:

| Well actually I'm just nosy... dynamic_cast<type-it>(expr)
| 
| How actually does the c++ realize this? I mean does it know at runtime the
| type of expr? 

Every object of polymorphic type knows its dynamic type.

| ... Does it add some ID fiels to the class "structure"? 

Sort of.

| ... If so how is
| this ID caluclated? 

Mosty by comparing pointers to objects supposed to tag types.  The
best documentation is the source code.

-- Gaby
CodeSourcery, LLC                       http://www.codesourcery.com



More information about the Gcc mailing list