> I read the recent thread about casting Insets up to
> their "real" type and thought I'd try and implement André's
> asAInset, asBInset, asCInset thing using templates.
>
> Unfortunately, it doesn't compile :-(
>
> Is their anyway to do this?

No, you can't have templated virtual member functions.
Just think about how the vtable should look like if
different translation units ask for different instantations
of such functions.

But if even egcs 2.91.66 does dynamic_cast<> we could probably
drop the asFooInset functions in the next cycle and go for
straight RTTI...

> aleem@pneumon:aleem-> cxx -std strict_ansi -o trial trial.C
> cxx: Error: trial.C, line 6: "virtual" is not allowed in a function
> template
>          declaration

Exactly.

Andre'


Reply via email to