Re: [ROOT] dynamic_cast CInt problem with TObject?

From: Masaharu Goto (MXJ02154@nifty.ne.jp)
Date: Fri Aug 09 2002 - 17:16:55 MEST


Hello Pierre-Luc,

This is a Cint limitation described in $CINTSYSDIR/doc/limitati.txt.
Cint converts the type without checking public inheritance with
dynamic_cast.  In this case, dynamic_cast should return 0, but
Cint does not check validity of the conversion and returns non
0 value.

Thank you
Masaharu Goto

----- Original Message -----
From: "Pierre-Luc Drouin" <pldrouin@physics.carleton.ca>
To: <roottalk@pcroot.cern.ch>
Sent: Tuesday, July 30, 2002 2:11 AM
Subject: [ROOT] dynamic_cast CInt problem with TObject?


> Hello,
>
> Is there a problem with dynamic_cast in CInt?
>
> >From ROOT interpreter:
>
> TObject* a=new TObject;
> root [1] cout << dynamic_cast<TH1F*>(a) << "\n";
> 0x87d2158
>
> When I compile this code with g++, I get a NULL value for the dynamic_cast
> (like it is expected), but it's not NULL with CInt.
>
> Pierre-Luc Drouin
> SNO, Carleton University
>



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:03 MET