This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]