mi_cast
Scott Wheeler
wheeler at kde.org
Thu Oct 2 12:19:27 BST 2003
After a few recent threads on kde-cvs I've come to wonder if a simple define
in one of the KDE headers would be of some utility --
Specifically I'd like to add a:
#define mi_cast dynamic_cast
Alternatively something like:
template <class From, class To> To mi_cast(From v)
{
return dynamic_cast<To>(v);
}
Should work, but I think would be less semantically nice...
Or something similar -- whatever -- we simply have the problem that a lot of
people don't know how to use dynamic_cast and when reading through sources you
often hit false positives where it was actually someone using a dynamic_cast
to cast "sideways" across a multiple inheritance hierarchy.
It would be nice if we had a "I know what I'm doing" indicator of sorts.
Thoughts? Flames?
-Scott
--
There are 10 types of people in the world: Those who understand binary, and
those who don't.
More information about the kde-core-devel
mailing list