how to implement dynamic_cast???

K

kuangye

Hi all.

Is there any document/paper/book that discus about how to implement
dynamic_cast.....
 
E

Erik Wikström

Hi all.

Is there any document/paper/book that discus about how to implement
dynamic_cast.....

Are you trying to implement your own C++ compiler?

This is kind of off-topic but I do not know of a better place to ask.

I think that dynamic_cast is usually implemented by looking at the
objects vtable pointer, if it points to the type you are casting to then
the cast succeeds. You also have to check if you are trying to cast to a
subtype of the current object.
 
F

Fran

Is there any document/paper/book that discus about how to implement
dynamic_cast.....

You don't implement dynamic_cast, the compiler implements it. You
just use it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top