Implementation of static_cast<> (Bond)
14 Jan 2002 02:00:59 -0500

          From comp.compilers

Related articles
Implementation of static_cast<> (2002-01-14)
Re: Implementation of static_cast<> (Alain Miniussi) (2002-01-17)
Re: Implementation of static_cast<> (2002-01-17)
| List of all articles for this month |

From: (Bond)
Newsgroups: comp.compilers
Date: 14 Jan 2002 02:00:59 -0500
Keywords: C++, question
Posted-Date: 14 Jan 2002 02:00:59 EST


Im curious to know the implementation of static_cast<> by the C++ compiler.
Since it is a better version than "C" style casts...

I assume something like:

1) try to get the type of the non-polymorphic object. something like "typeid()"
2) try to match the given pointer/type to the type of the template parameter
3) If success return after casting ( "C" style ? ) else return null.

Any thoughts?


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.