RE: [C++-sig] Re: Automatic downcast question
by Stefan Franke other posts by this author
Jun 15 2003 8:33PM messages near this date
Re: [C++-sig] Re: Documentation suggestion
|
[C++-sig] Re: Automatic downcast question
> -----Original Message-----
> From: c++-sig-admin@[...].org [mailto:c++-sig-admin@[...].org]On
> Behalf Of David Abrahams
...
> I think it's reasonable to try to convert directly to the actual type
> of the pointee (C), but I don't think it's reasonable to try
> downcasting to every known derived class of the pointee's static type.
But "every known derived class" is not what I was asking for. Rather
"the lowermost class on the inheritance graph from the pointee's static
type to its actual type that has been registered to BPL via bases<> ".
(Sorry if my English is weird).
This is typically exactly one class (B), unless with diamond-shaped
inheritance. In this case a non-ambivalent base class could be chosen.
> We could consider implementing that as a new return value policy,
> though, so you can ask for it when you need it.
Another option (at least for me) would be to be able to dynamically
cast a wrapped A to a wrapped C instance. Is that possible?
Stefan Franke
www.ableton.com
Attachments:
unknown1
Thread:
Stefan Franke
David Abrahams
|