|
![](/i/fill.gif) |
In article <3fe42517@news.povray.org> , Wolfgang Wieser <wwi### [at] gmx de>
wrote:
> Obviously, you can cast A to B without either one being derived
> from the other one just because they share a common parent.
>
> I must admit that I did not spend a lot of time on thinking but
> as for now, I cannot imagine any algoritm which can perform the
> above dymanic_cast without doing tree traversal.
You may recall one can keep binary trees in an array. Essentially, if you
take away the need to add and remove elements (as C++ class inheritance is
fixed this requirement is fulfilled), you actually have to fold the whole
"tree" to a list. The exact rules, while well defined, are a bit
complicated, but what exactly has to happen is specified in the ISO C++
specification...
Thorsten
____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trf de
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
![](/i/fill.gif) |