This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: c++ dynamic typecasts... (just nosy)
- To: Axel Kittenberger <Anshil at gmx dot net>
- Subject: Re: c++ dynamic typecasts... (just nosy)
- From: Gabriel Dos Reis <gdr at codesourcery dot com>
- Date: 26 Feb 2001 19:58:00 +0100
- Cc: gcc at gcc dot gnu dot org
- Organization: CodeSourcery, LLC
- References: <400.983213049@www14.gmx.net>
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