nel-all
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nel] dynamic_cast pbs...


From: Lionel Berenguier
Subject: Re: [Nel] dynamic_cast pbs...
Date: Fri, 15 Mar 2002 11:15:43 +0100

> Hello Lionel,
>
> I don't think that dynamic cast by itself is at fault. In fact, in many
cases,
> a call to "safe_cast" work properly, and many direct call to dynamic_cast
> are also ok. The problem only arises in the few cases I have mentionned,
> i.e: when casting BEFORE using dynamic_cast. I may be wrong, but I don't
> think that casting Shape to (IShape*) before safe_cast will utterly
transform
> the object pointed by Shape to an IShape... But then, I haven't had the
time
> to check the inheritance of both Shape and CMesh or CParticleSystemShape
> for exemple.
>

Actually Shape is CSmartPtr<IShape>, this is why we cast it to a IShape*
before (CSmartPtr define a cast operator). Hence the cast should be ok and
valid.

Maybe the problem is with the cast operator (or a conjunction of the 2). NB:
the patch of loic dachary in scene.cpp, line 473, is maybe based on the same
problem.

Lionel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]