"Paul A. Dugas" wrote:
> > Why not use the shorter Handle() or VoidHand() cast syntax?
> 
> Maybe I'm being thick skulled here.
>         {
>                 VoidHand foo = ...
>                 routine_taking_a_handle( Handle(foo) );
>         }
> Doesn't this construct a second (temporary) pointer in the scope, 
> assign "foo" to it, then pass it to the routine?

No, this should be the kind of cast that just makes the compiler happy
and has zero effect on the generated code.  In fact in this case all of
these forms should yield exactly the same output:

        reinterpret_cast< Handle >( ... )
        Handle( ... )
        (Handle)( ... )

When in doubt, inspect the asm output.  It's easy to do in CodeWarrior
and hopefully possible in GCC too.

-slj-

Reply via email to