Dynamic_cast

Hi.
CINT (at least in ROOT) does not support dynamic_cast, am I right?

[quote]root[0] TObject *hist = new TH2D;
root[1] hist
(class TObject *)0x18238e8
root[2]dynamic_cast<TGCanvas *>(hist)
(class TGCanvas *)0x18238e8
root[3][/quote]

Correct. It currently acts as a C style cast.

Philippe

[quote]
Correct. It currently acts as a C style cast.
Philippe[/quote]

Ok, so a warning from the cint would be good:)) Not to have some hard-to-debug errors :slight_smile:)

Hi,

before you spend your time implementing the error message you were hoping to get you might as well implement dynamic_cast in CINT. An implementation covering 90% of all cases (which is a start) should be rather straight forward.

I’m sort of half serious :slight_smile:

Cheers, Axel.

[quote=“Axel”]Hi,

before you spend your time implementing the error message you were hoping to get you might as well implement dynamic_cast in CINT. An implementation covering 90% of all cases (which is a start) should be rather straight forward.

I’m sort of half serious :slight_smile:

Cheers, Axel.[/quote]

I’ll be happy to do that :slight_smile:) But I’m afraid, I’ll spend a lot of time just looking at CINT’s source code - I guess it’s not the simplest programm in the world. :slight_smile: