This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Turning off C++ casting?
- From: Jack Lloyd <lloyd at acm dot jhu dot edu>
- To: Vladimir Merzliakov <wanderer at rsu dot ru>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Thu, 20 Feb 2003 12:57:19 -0500 (EST)
- Subject: Re: Turning off C++ casting?
- Organization: JHU ACM/CS/SRL
On Thu, 20 Feb 2003, Vladimir Merzliakov wrote:
> I think expression:
>
> (dynamic_cast<T*>(v)==0 || dynamic_cast<T*>(v)==reinterpret_cast<T*>(v))
>
> can be false in case multiply inheritance and virtual inheritance.
Yes, I've run into this before, where dynamic_cast works and a normal
C-style cast or static_cast does not (which can be exceptionally confusing
the first time you run into it).
-Jack