POV-Ray : Newsgroups : povray.off-topic : Generics annoyance : Re: Generics annoyance Server Time
4 Sep 2024 13:18:17 EDT (-0400)
  Re: Generics annoyance  
From: Darren New
Date: 15 Apr 2010 11:20:16
Message: <4bc72eb0$1@news.povray.org>
Warp wrote:
>   The dynamic_cast will succeed if the object pointed by aPtr is in actuality
> of a type which has been multiple-inherited from A and B (even if by a very
> long inheritance chain). The foo() function doesn't need to know anything
> about that class in question, and can eg. be precompiled into a library.

That's what I thought you meant. I know you can't do it with a non-dynamic 
cast in Eiffel, but I don't remember if you can do that in one step with a 
dynamic cast. In all honesty, I would expect not. Meyer isn't that sort of 
person. :-)

I can see where that could be handy, and even moreso if it weren't an 
explicit dynamic cast. (I.e., if you could just pass aPtr into a function 
expecting a bPtr and have it work automagically if the actual type inherited 
from both.)

-- 
Darren New, San Diego CA, USA (PST)
   Yes, we're traveling together,
   but to different destinations.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.